X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=jjb%2Fpti-rtp%2Fupload-inf.sh;h=a472e497156b910a1aefcad19ef0e359b6d4f21e;hb=a79be2ae71d94832ab5d7fae0bc7ebc2de257f14;hp=448269167d51e0865af4c19c29d14e20052d2691;hpb=ecb0a85b911fb70cbb8706aa47e856dfc843cab2;p=ci-management.git diff --git a/jjb/pti-rtp/upload-inf.sh b/jjb/pti-rtp/upload-inf.sh index 44826916..a472e497 100644 --- a/jjb/pti-rtp/upload-inf.sh +++ b/jjb/pti-rtp/upload-inf.sh @@ -21,16 +21,22 @@ echo "--> upload-inf.sh" # Ensure we fail the job if any steps fail. set -eu -o pipefail -echo "INFO: creating virtual environment" -virtualenv -p python3 /tmp/venv -PATH=/tmp/venv/bin:$PATH +if [[ -f ~/lf-env.sh ]]; then + # shellcheck source=/dev/null + . ~/lf-env.sh + lf-activate-venv --python python3 lftools +else + echo "INFO: creating virtual environment" + virtualenv -p python3 /tmp/venv + PATH=/tmp/venv/bin:$PATH -pip_pkgs="pip setuptools lftools" -for pkg in $pip_pkgs; do - cmd_pip="python -m pip install -q --upgrade $pkg" - echo "INFO: installing packages: $cmd_pip" - $cmd_pip -done + pip_pkgs="pip setuptools lftools" + for pkg in $pip_pkgs; do + cmd_pip="python -m pip install --upgrade $pkg" + echo "INFO: installing packages: $cmd_pip" + $cmd_pip + done +fi # NEXUS_URL is set by Jenkins nexus_repo_id="images" @@ -47,15 +53,23 @@ mkdir -p "$repo_iso_dir_latest" "$repo_iso_dir_branch" # in build subdir: workspace/workspace_yocto/prj_output/ iso_yocto="workspace/workspace_yocto/prj_output/inf-image-yocto-aio-x86-64.iso" +# Expect Debian based ISO file: inf-image-debian-all-x86-64.iso +# in build subdir: workspace/workspace_debian/prj_output/ +iso_debian="workspace/workspace_debian/prj_output/inf-image-debian-all-x86-64.iso" + # Expect CentOS based ISO file: inf-image-centos-all-x86-64.iso # in build subdir: workspace/workspace_centos/prj_output/ iso_centos="workspace/workspace_centos/prj_output/inf-image-centos-all-x86-64.iso" -echo "INFO: copy $iso_yocto and $iso_centos to staging directory $repo_iso_dir_latest" -cp "$iso_yocto" "$iso_centos" "$repo_iso_dir_latest" - -echo "INFO: copy $iso_yocto and $iso_centos to staging directory $repo_iso_dir_branch" -cp "$iso_yocto" "$iso_centos" "$repo_iso_dir_branch" +for iso_dir in $repo_iso_dir_latest $repo_iso_dir_branch; do + echo "INFO: copy ISO images to staging directory $iso_dir" + for iso_img in $iso_yocto $iso_centos $iso_debian; do + if [[ -f $iso_img ]]; then + echo "INFO: copying $iso_img" + cp "$iso_img" "$iso_dir" + fi + done +done cmd="lftools deploy nexus $nexus_repo_url $repo_dir" echo "INFO: Upload ISO to Nexus: $cmd"