diff options
author | Fatih Degirmenci <fatih.degirmenci@ericsson.com> | 2016-12-15 20:43:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-12-15 20:43:34 +0000 |
commit | d8ec3fcab553c186736224caa1a1f187dff7bdc5 (patch) | |
tree | 7326d6e2bebbc691faaaa54f75ce9b84419b0428 /jjb/netready/netready-gluon-build.sh | |
parent | 508f72a1bec40410e1c008f13fbdfaf2cf56611d (diff) | |
parent | 1541e31316dfbd05733dd73d4d98ef3d412f86f9 (diff) |
Merge "Basic CI integration for building Gluon packages"
Diffstat (limited to 'jjb/netready/netready-gluon-build.sh')
-rwxr-xr-x | jjb/netready/netready-gluon-build.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/jjb/netready/netready-gluon-build.sh b/jjb/netready/netready-gluon-build.sh new file mode 100755 index 000000000..5904c8407 --- /dev/null +++ b/jjb/netready/netready-gluon-build.sh @@ -0,0 +1,44 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +echo "Building Gluon packages." +echo "------------------------" +echo + +if [ "$ARTIFACT_VERSION" == "daily" ]; then + export OPNFV_ARTIFACT_VERSION=$(echo $(date -u +"%Y%m%d")) +fi + +# build all packages +cd $WORKSPACE/ci +./build-gluon-packages.sh + +# list the contents of BUILD_OUTPUT directory +echo "Build Directory is ${BUILD_DIRECTORY}" +echo "Build Directory Contents:" +echo "---------------------------------------" +ls -alR $BUILD_DIRECTORY + +# get version infos from Gluon from spec +GLUON_VERSION=$(grep Version: $BUILD_DIRECTORY/rpm_specs/gluon.spec | awk '{ print $2 }') +GLUON_RELEASE=$(grep 'define release' $BUILD_DIRECTORY/rpm_specs/gluon.spec | awk '{ print $3 }')_$OPNFV_ARTIFACT_VERSION + +ARTIFACT_NAME=gluon-$GLUON_VERSION-$GLUON_RELEASE.noarch.rpm +ARTIFACT_PATH=$BUILD_DIRECTORY/noarch/$ARTIFACT_NAME + +echo "Writing opnfv.properties file" +# save information regarding artifact into file +( + echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION" + echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)" + echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)" + echo "OPNFV_ARTIFACT_URL=$GS_URL/$ARTIFACT_NAME" + echo "OPNFV_ARTIFACT_SHA512SUM=$(sha512sum $ARTIFACT_PATH | cut -d' ' -f1)" + echo "OPNFV_BUILD_URL=$BUILD_URL" + echo "ARTIFACT_LIST=$ARTIFACT_PATH" +) > $WORKSPACE/opnfv.properties + +echo "---------------------------------------" +echo "Done!" |