Make link to tar from BUNDLEURL, use for build-rpm 97/52697/3
authorDaniel Farrell <dfarrell@redhat.com>
Fri, 3 Mar 2017 01:18:00 +0000 (20:18 -0500)
committerDaniel Farrell <dfarrell@redhat.com>
Tue, 7 Mar 2017 03:27:20 +0000 (22:27 -0500)
RPM specfiles typically use tarball build inputs, not zips. When
triggering from autorelease, we need to convert the BUNDLEURL link to
the zip-archive distro into one for the tarball distro.

Could also do this by creating a new variable parallel to BUNDLEURL for
passing a link to the tarball, something like BUNDLETARURL. I started on
this in [1] but think it's not worth the complexity, unlikely to be
reused.

[1]: https://git.opendaylight.org/gerrit/#/c/52693/

This fixes:

trello.com/c/qcwHU9u1/446-fix-build-rpm-jobs-triggered-by-autorelease

Change-Id: Ic9b4a998a4f823f4a3a3b1ef3ac0f604cf03565f
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
jjb/packaging/include-raw-build-rpm.sh

index a0582e33f469c54957a17649648089bfa6883cbe..ab788d91baad9b67e0f9440e34a12bff2738a7a1 100644 (file)
@@ -12,8 +12,11 @@ source rpm_build/bin/activate
 pip install --upgrade pip
 pip install -r $WORKSPACE/packaging/rpm/requirements.txt
 
+# Make a URL for the tarball artifact from DOWNLOAD_URL (a zip)
+download_url="${{DOWNLOAD_URL//zip/tar.gz}}"
+
 # Build release specified by build params
-$WORKSPACE/packaging/rpm/build.py --download_url "$DOWNLOAD_URL" \
+$WORKSPACE/packaging/rpm/build.py --download_url "$download_url" \
                                   --sysd_commit "$SYSD_COMMIT" \
                                   --changelog_date "$CHANGELOG_DATE" \
                                   --changelog_name "$CHANGELOG_NAME" \