From 510cb355637ceaa781e2f54c67a97ea6df860351 Mon Sep 17 00:00:00 2001
From: Giulia Naponiello <gnaponie@redhat.com>
Date: Mar 04 2020 14:58:41 +0000
Subject: Let's try to migrate to fedora-30 in Jenkins and Docker files


Signed-off-by: Giulia Naponiello <gnaponie@redhat.com>

---

diff --git a/Dockerfile b/Dockerfile
index 9bafc24..fffc441 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM fedora:29
+FROM fedora:30
 LABEL \
     name="Freshmaker application" \
     vendor="Freshmaker developers" \
@@ -11,13 +11,13 @@ COPY $freshmaker_rpm /tmp
 
 RUN cd /etc/yum.repos.d/ \
     && dnf -v -y install 'dnf-command(config-manager)' \
-    && dnf config-manager --add-repo http://download-ipv4.eng.brq.redhat.com/rel-eng/RCMTOOLS/latest-RCMTOOLS-2-F-29/compose/Everything/x86_64/os/ \
+    && dnf config-manager --add-repo http://download-ipv4.eng.brq.redhat.com/rel-eng/RCMTOOLS/latest-RCMTOOLS-2-F-30/compose/Everything/x86_64/os/ \
     && dnf -y clean all \
     && dnf -v --nogpg -y install \
     httpd python3-mod_wsgi mod_auth_gssapi python3-rhmsg mod_ssl python3-odcs-client \
     /tmp/$(basename $freshmaker_rpm) \
-    && dnf -y -v downgrade https://kojipkgs.fedoraproject.org//packages/qpid-proton/0.26.0/1.fc29/x86_64/qpid-proton-c-0.26.0-1.fc29.x86_64.rpm \
-    https://kojipkgs.fedoraproject.org//packages/qpid-proton/0.26.0/1.fc29/x86_64/python3-qpid-proton-0.26.0-1.fc29.x86_64.rpm \
+    && dnf -y -v downgrade https://kojipkgs.fedoraproject.org//packages/qpid-proton/0.26.0/1.fc30/x86_64/qpid-proton-c-0.26.0-1.fc30.x86_64.rpm \
+    https://kojipkgs.fedoraproject.org//packages/qpid-proton/0.26.0/1.fc30/x86_64/python3-qpid-proton-0.26.0-1.fc30.x86_64.rpm \
     && dnf -y -v upgrade https://kojipkgs.fedoraproject.org/packages/kobo/0.10.0/1.fc31/noarch/python3-kobo-0.10.0-1.fc31.noarch.rpm \
     https://kojipkgs.fedoraproject.org/packages/kobo/0.10.0/1.fc31/noarch/python3-kobo-rpmlib-0.10.0-1.fc31.noarch.rpm \
     && dnf -y clean all \
diff --git a/Jenkinsfile b/Jenkinsfile
index 2989c2a..76293ea 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -42,7 +42,7 @@ node('master'){
 
     timestamps {
 
-node('fedora-29') {
+node('fedora-30') {
     stage('Prepare') {
         checkout scm
         sh 'sudo rm -f rpmbuild-output/*.src.rpm'
@@ -118,11 +118,11 @@ node('fedora-29') {
         parallel (
             'F29': {
                 sh """
-                mkdir -p mock-result/f29
-                flock /etc/mock/fedora-29-x86_64.cfg \
-                /usr/bin/mock -v --enable-network --resultdir=mock-result/f29 -r fedora-29-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm
+                mkdir -p mock-result/f30
+                flock /etc/mock/fedora-30-x86_64.cfg \
+                /usr/bin/mock -v --enable-network --resultdir=mock-result/f30 -r fedora-30-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm
                 """
-                archiveArtifacts artifacts: 'mock-result/f29/**'
+                archiveArtifacts artifacts: 'mock-result/f30/**'
             },
         )
     }
@@ -132,11 +132,11 @@ node('docker') {
     stage('Build Docker container') {
         checkout scm
         // Remember to reflect the version change in the Dockerfile in the future.
-        sh 'grep -q "FROM fedora:29" Dockerfile'
-        unarchive mapping: ['mock-result/f29/': '.']
-        def f29_rpm = findFiles(glob: 'mock-result/f29/**/*.noarch.rpm')[0]
+        sh 'grep -q "FROM fedora:30" Dockerfile'
+        unarchive mapping: ['mock-result/f30/': '.']
+        def f30_rpm = findFiles(glob: 'mock-result/f30/**/*.noarch.rpm')[0]
         def appversion = sh(returnStdout: true, script: """
-            rpm2cpio ${f29_rpm} | \
+            rpm2cpio ${f30_rpm} | \
             cpio --quiet --extract --to-stdout ./usr/lib/python\\*/site-packages/freshmaker\\*.egg-info/PKG-INFO | \
             awk '/^Version: / {print \$2}'
         """).trim()
@@ -150,7 +150,7 @@ node('docker') {
             /* 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 "factory2/freshmaker:internal-${appversion}", "--build-arg freshmaker_rpm=$f29_rpm --build-arg cacert_url=https://password.corp.redhat.com/RH-IT-Root-CA.crt ."
+            def image = docker.build "factory2/freshmaker:internal-${appversion}", "--build-arg freshmaker_rpm=$f30_rpm --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. */
@@ -162,7 +162,7 @@ node('docker') {
         docker.withRegistry(
                 'https://quay.io/',
                 'quay-io-factory2-builder-sa-credentials') {
-            def image = docker.build "factory2/freshmaker:${appversion}", "--build-arg freshmaker_rpm=$f29_rpm ."
+            def image = docker.build "factory2/freshmaker:${appversion}", "--build-arg freshmaker_rpm=$f30_rpm ."
             image.push()
         }
         /* Save container version for later steps (this is ugly but I can't find anything better...) */

