6 # -o pipefail: Fail on errors in scripts this calls, give stacktrace
9 # Install required packages
11 # shellcheck disable=SC1091
12 source rpm_build/bin/activate
13 PYTHON="rpm_build/bin/python"
14 $PYTHON -m pip install --upgrade pip
15 $PYTHON -m pip install -r "$WORKSPACE/packaging/packages/requirements.txt"
17 # Convert stream to numeric ODL major version
18 if [ "$STREAM" == "carbon" ]; then
20 elif [ "$STREAM" == "nitrogen" ]; then
22 elif [ "$STREAM" == "oxygen" ]; then
25 echo "Unable to convert stream to major version"
29 # Build the latest snapshot matching the given major minor version
30 "$WORKSPACE/packaging/packages/build.py" --rpm \
31 --changelog_name "$CHANGELOG_NAME" \
32 --changelog_email "$CHANGELOG_EMAIL" \
34 --major "$VERSION_MAJOR"
36 # Publish RPMs to Nexus if in production Jenkins, else host on sandbox Jenkins
37 if [ "$SILO" == "sandbox" ]; then
38 # TODO: Host RPMs on Jenkins temporarily
39 echo "Not uploading RPMs to Nexus because running in sandbox"
40 elif [ "$SILO" == "releng" ]; then
41 # Move RPMs (SRPM and noarch) to dir of files that will be uploaded to Nexus
42 UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
43 mkdir -p "$UPLOAD_FILES_PATH"
44 cp "/home/$USER/rpmbuild/RPMS/noarch/"*.rpm "$_"
45 cp "/home/$USER/rpmbuild/SRPMS/"*.rpm "$_"
47 echo "Unknown Jenkins silo: $SILO"