jenkinsfile.release: build and deploy website in release pipeline
@@ -72,7 +72,7 @@ stage('Release') {
parallel generateReleaseStages()
}
-stage('Build docker images for package testing') {
+stage('Build website and docker images for package testing') {
parallel generateDockerBuildStagesWithPackagesInstalled()
}
@@ -91,6 +91,10 @@ stage('Upload release Docker images') {
parallel generateImageUploadStages()
}
+stage('Main repository and website publish') {
+ parallel generateFinalPublishStages()
+}
+
/**************/
/* Generators */
/**************/
@@ -247,6 +251,14 @@ def dockerInit() {
'./scripts/docker/alpine/*/release.Dockerfile',
false
)
+
+ /* Image building the libelektra.org website */
+ DOCKER_IMAGES.website = dockerUtils.createDockerImageDesc(
+ "website-release", dockerUtils.&idArtifact,
+ ".",
+ "./scripts/docker/website/Dockerfile",
+ false
+ )
}
}
@@ -330,6 +342,9 @@ def generateDockerBuildStagesWithPackagesInstalled() {
'debian-bullseye'
)
+ // build website
+ tasks << buildWebsite('debian-buster')
+
return tasks
}
@@ -457,11 +472,20 @@ def generatePublishStages() {
// publish source package built in debian-buster stage
tasks << publishSource('debian-buster')
+
+ tasks << buildAndPublishMaven()
+
+ return tasks
+}
+
+def generateFinalPublishStages() {
+ def tasks = [:]
+
// publish main repo which got modified during the
// debian-buster release stage
tasks << publishMainRepo('debian-buster')
-
- tasks << buildAndPublishMaven()
+ // publish website
+ tasks << release.deployWebsite(DOCKER_IMAGES.website)
return tasks
}
@@ -769,6 +793,34 @@ ${WORKSPACE}/build/doc/man ./"""
}]
}
+def buildWebsite(mainRepoArtifactStageName) {
+ def stageName = 'buildWebsite'
+ return [(stageName): {
+ stage(stageName) {
+ node(PipelineConfig.instance.dockerNodeLabel) {
+ echo "Starting ${env.STAGE_NAME} on ${env.NODE_NAME}"
+ configureGitUser()
+ copyArtifacts(
+ filter: "artifacts/${mainRepoArtifactStageName}/libelektra.bundle",
+ fingerprintArtifacts: true,
+ projectName: '${JOB_NAME}',
+ selector: specific('${BUILD_NUMBER}')
+ )
+
+ dir('libelektra') {
+ deleteDir()
+ git branch: 'master',
+ url: 'https://github.com/ElektraInitiative/libelektra.git'
+ sh "git bundle verify ${WORKSPACE}/artifacts/${artifactStageName}/libelektra.bundle"
+ sh "git pull --ff-only ${WORKSPACE}/artifacts/${artifactStageName}/libelektra.bundle"
+
+ dockerUtils.buildImage(DOCKER_IMAGES.website)
+ }
+ }
+ }
+ }]
+}
+
/**
* Build and publish jna bindings to maven repository
*
