Allow pushing to scratch repos from sandbox 18/73418/2
authorDaniel Farrell <dfarrell@redhat.com>
Mon, 25 Jun 2018 19:30:06 +0000 (15:30 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Wed, 27 Jun 2018 20:24:28 +0000 (16:24 -0400)
Start changing JJB to support deploying packages to scratch repos. This
will eventually allow devs to build RPMs from pre-merged logic and have
them hosted on Nexus without polluting the CD devel repos.

Change-Id: Ia1e478bb87cdcaf4020025f9379ed559ead18ccf
Jira: INTPAK-161
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
jjb/packaging/build-rpm.sh
jjb/packaging/packaging.yaml

index 3911cc15ac45880cbfafe51527b68b91fa63e565..4f2f0d620454fd371cd861a8d51c5675f39d1530 100644 (file)
@@ -48,16 +48,25 @@ fi
                                          direct \
                                          --download_url "$DOWNLOAD_URL"
 
-# Publish RPMs to Nexus if in production Jenkins, else host on sandbox Jenkins
-if [ "$SILO" == "sandbox" ]; then
-  echo "Not uploading RPMs to Nexus because running in sandbox"
-elif  [ "$SILO" == "releng" ]; then
+# Always allow push to scratch repos, only push to CD repos in RelEng Jenkins
+if [ "$DEPLOY_TO_REPO" == "opendaylight-epel-7-x86_64-devel" ]; then
   # Move RPMs (SRPM and noarch) to dir of files that will be uploaded to Nexus
   UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
   mkdir -p "$UPLOAD_FILES_PATH"
   cp "$HOME/rpmbuild/RPMS/noarch/"*.rpm "$_"
   cp "$HOME/rpmbuild/SRPMS/"*.rpm "$_"
 else
-  echo "Unknown Jenkins silo: $SILO"
-  exit 1
+  # Publish RPMs to CD repos if in production Jenkins, not in sandbox Jenkins
+  if [ "$SILO" == "sandbox" ]; then
+    echo "Not uploading RPMs to Nexus because running in sandbox"
+  elif  [ "$SILO" == "releng" ]; then
+    # Move RPMs (SRPM+noarch) to dir of files that will be uploaded to Nexus
+    UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
+    mkdir -p "$UPLOAD_FILES_PATH"
+    cp "$HOME/rpmbuild/RPMS/noarch/"*.rpm "$_"
+    cp "$HOME/rpmbuild/SRPMS/"*.rpm "$_"
+  else
+    echo "Unknown Jenkins silo: $SILO"
+    exit 1
+  fi
 fi
index aa2b85a0912436a278d70f07b2ef8b42eb6d97e4..7e8887ea5d74ad19be404184edd037d9505d3028 100644 (file)
           name: CHANGELOG_EMAIL
           default: 'jenkins-donotreply@opendaylight.org'
           description: 'Email of person who defined RPM'
+      - string:
+          name: DEPLOY_TO_REPO
+          default: 'opendaylight-{stream}-epel-7-x86_64-devel'
+          description: 'Repository to deploy resulting package to'
 
     scm:
       - integration-gerrit-scm:
@@ -95,7 +99,7 @@
           global-settings-file: 'global-settings'
           settings-file: 'packaging-settings'
           mvn-version: '{mvn-version}'
-          repo-id: 'opendaylight-{stream}-epel-7-x86_64-devel'
+          repo-id: '$DEPLOY_TO_REPO'
           group-id: '{group-id}'
           upload-files-dir: '{upload-files-dir}'
           maven-repo-url: '{maven-repo-url}'