]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-installer-rpm: abstract build script 585/head
authorKen Dreyer <kdreyer@redhat.com>
Thu, 8 Dec 2016 20:33:03 +0000 (13:33 -0700)
committerKen Dreyer <kdreyer@redhat.com>
Thu, 8 Dec 2016 20:33:03 +0000 (13:33 -0700)
Don't hardcode the "ceph-installer" package name in the
ceph-installer-rpm build script. Determine the package name from the
Jenkins job name instead.

The purpose of this change is to make the build script more re-usable
between different packages. (Eventually we could use JJB templates to
construct multiple jobs using these same build steps.)

ceph-installer-rpm/build/build

index 06b4afdb2d7a1d5997e7de234909de237ec7f28c..4541d4d4058912d41506578e521311a235804072 100644 (file)
@@ -4,6 +4,10 @@ set -ex
 
 # Sanity-check:
 [ -z "$GIT_BRANCH" ] && echo Missing GIT_BRANCH variable && exit 1
+[ -z "$JOB_NAME" ] && echo Missing JOB_NAME variable && exit 1
+
+# Strip "-rpm" off the job name to get our package's name
+PACKAGE=${JOB_NAME%-rpm}
 
 sudo yum -y install epel-release
 sudo yum -y install fedpkg
@@ -27,7 +31,7 @@ make_chacractl_config $chacra_url
 BRANCH=`branch_slash_filter $GIT_BRANCH`
 
 ## Upload the created RPMs to chacra
-chacra_endpoint="ceph-installer/${BRANCH}/${GIT_COMMIT}/centos/7"
+chacra_endpoint="${PACKAGE}/${BRANCH}/${GIT_COMMIT}/centos/7"
 
 [ "$FORCE" = true ] && chacra_flags="--force" || chacra_flags=""