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 # Extract stream from job name (format: foo-job-name-<stream>)
18 # shellcheck disable=SC1083
19 STREAM=${{JOB_NAME##*-}}
21 # Convert stream to numeric ODL major version
22 if [ "$STREAM" == "boron" ]; then
24 elif [ "$STREAM" == "carbon" ]; then
26 elif [ "$STREAM" == "nitrogen" ]; then
28 elif [ "$STREAM" == "oxygen" ]; then
31 echo "Unable to convert stream to major version"
35 # Build the latest snapshot matching the given major minor version
36 "$WORKSPACE/packaging/packages/build.py" --rpm --build-latest-snap \
37 --major "$VERSION_MAJOR" \
38 --changelog_name "$CHANGELOG_NAME" \
39 --changelog_email "$CHANGELOG_EMAIL"
41 # Copy the rpm to be upload
42 UPLOAD_FILES_PATH="$WORKSPACE/upload_files"
43 mkdir -p "$UPLOAD_FILES_PATH"
44 mv "/home/$USER/rpmbuild/RPMS/noarch/"*.rpm "$_"
45 mv "/home/$USER/rpmbuild/SRPMS/"*.rpm "$_"