#405 Jenkinsfile: Build documentation after the container image.
Merged 3 years ago by lsedlar. Opened 3 years ago by jkaluza.
jkaluza/odcs f31  into  master

file modified
+42 -42
@@ -31,6 +31,48 @@ 

  }

  

  timestamps {

+ node('docker') {

+     checkout scm

+     stage('Build Docker container') {

+         /* Remove python2-only dependencies or dependencies we do not need

+          * in the container image like pyldap or koji.

+          * */

+         sh "sed -i '/futures/d' ./server/requirements.txt"

+         sh "sed -i '/funcsigs/d' ./server/requirements.txt"

+         sh "sed -i '/koji/d' ./server/requirements.txt"

+         sh "sed -i '/pyldap/d' ./server/requirements.txt"

+         sh "sed -i '/funcsigs/d' ./client/requirements.txt"

+         def appversion = sh(returnStdout: true, script: './get-version.sh').trim()

+         /* Git builds will have a version like 0.3.2.dev1+git.3abbb08 following

+          * the rules in PEP440. But Docker does not let us have + in the tag

+          * name, so let's munge it here. */

+         appversion = appversion.replace('+', '-')

+         /* Git builds will have a version like 0.3.2.dev1+git.3abbb08 following

+          * the rules in PEP440. But Docker does not let us have + in the tag

+          * name, so let's munge it here. */

+         docker.withRegistry(

+                 'https://docker-registry.upshift.redhat.com/',

+                 'compose-upshift-registry-token') {

+             /* Note that the docker.build step has some magic to guess the

+              * Dockerfile used, which will break if the build directory (here ".")

+              * is not the final argument in the string. */

+             def image = docker.build "compose/odcs:internal-${appversion}", "--build-arg cacert_url=https://password.corp.redhat.com/RH-IT-Root-CA.crt ."

+             /* Pushes to the internal registry can sometimes randomly fail

+              * with "unknown blob" due to a known issue with the registry

+              * storage configuration. So we retry up to 3 times. */

+             retry(3) {

+                 image.push('latest')

+             }

+         }

+         /* Build and push the same image with the same tag to quay.io, but without the cacert. */

+ /*        docker.withRegistry(

+                 'https://quay.io/',

+                 'quay-io-factory2-builder-sa-credentials') {

+             def image = docker.build "factory2/odcs:${appversion}", "."

+             image.push()

+         }*/

+     }

+ }

  node('fedora-29') {

      checkout scm

      scmVars.GIT_AUTHOR_EMAIL = sh (
@@ -97,48 +139,6 @@ 

          }

      }

  }

- node('docker') {

-     checkout scm

-     stage('Build Docker container') {

-         /* Remove python2-only dependencies or dependencies we do not need

-          * in the container image like pyldap or koji.

-          * */

-         sh "sed -i '/futures/d' ./server/requirements.txt"

-         sh "sed -i '/funcsigs/d' ./server/requirements.txt"

-         sh "sed -i '/koji/d' ./server/requirements.txt"

-         sh "sed -i '/pyldap/d' ./server/requirements.txt"

-         sh "sed -i '/funcsigs/d' ./client/requirements.txt"

-         def appversion = sh(returnStdout: true, script: './get-version.sh').trim()

-         /* Git builds will have a version like 0.3.2.dev1+git.3abbb08 following

-          * the rules in PEP440. But Docker does not let us have + in the tag

-          * name, so let's munge it here. */

-         appversion = appversion.replace('+', '-')

-         /* Git builds will have a version like 0.3.2.dev1+git.3abbb08 following

-          * the rules in PEP440. But Docker does not let us have + in the tag

-          * name, so let's munge it here. */

-         docker.withRegistry(

-                 'https://docker-registry.upshift.redhat.com/',

-                 'compose-upshift-registry-token') {

-             /* Note that the docker.build step has some magic to guess the

-              * Dockerfile used, which will break if the build directory (here ".")

-              * is not the final argument in the string. */

-             def image = docker.build "compose/odcs:internal-${appversion}", "--build-arg cacert_url=https://password.corp.redhat.com/RH-IT-Root-CA.crt ."

-             /* Pushes to the internal registry can sometimes randomly fail

-              * with "unknown blob" due to a known issue with the registry

-              * storage configuration. So we retry up to 3 times. */

-             retry(3) {

-                 image.push('latest')

-             }

-         }

-         /* Build and push the same image with the same tag to quay.io, but without the cacert. */

- /*        docker.withRegistry(

-                 'https://quay.io/',

-                 'quay-io-factory2-builder-sa-credentials') {

-             def image = docker.build "factory2/odcs:${appversion}", "."

-             image.push()

-         }*/

-     }

- }

  

  } // end of timestamps

  } catch (e) {

This should prevent current issue when broken documentation build
blocks new ODCS container image.

Signed-off-by: Jan Kaluza jkaluza@redhat.com

Pull-Request has been merged by lsedlar

3 years ago