Lott, Christopher (cl778h) | d59c1b8 | 2019-11-14 09:06:25 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Bin Yang | 76b5afb | 2020-06-04 05:10:19 +0000 | [diff] [blame] | 3 | # Copyright (C) 2020 Wind River Systems, Inc. |
Lott, Christopher (cl778h) | d59c1b8 | 2019-11-14 09:06:25 -0500 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # Uploads a Yocto image to Nexus. |
| 18 | |
Bin Yang | 76b5afb | 2020-06-04 05:10:19 +0000 | [diff] [blame] | 19 | echo "--> upload-inf.sh" |
Lott, Christopher (cl778h) | d59c1b8 | 2019-11-14 09:06:25 -0500 | [diff] [blame] | 20 | |
| 21 | # Ensure we fail the job if any steps fail. |
| 22 | set -eu -o pipefail |
| 23 | |
| 24 | echo "INFO: creating virtual environment" |
| 25 | virtualenv -p python3 /tmp/venv |
| 26 | PATH=/tmp/venv/bin:$PATH |
| 27 | pipup="python -m pip install -q --upgrade lftools" |
| 28 | echo "INFO: installing packages: $pipup" |
| 29 | $pipup |
| 30 | |
| 31 | # NEXUS_URL is set by Jenkins |
| 32 | nexus_repo_id="images" |
| 33 | nexus_repo_url="$NEXUS_URL/content/sites/$nexus_repo_id" |
| 34 | echo "INFO: upload to $nexus_repo_url" |
| 35 | |
| 36 | repo_dir="$WORKSPACE/nexus/$nexus_repo_id" |
| 37 | # TODO: get build or version string; use latest for now |
| 38 | repo_iso_dir="$repo_dir/org/o-ran-sc/pti/rtp/latest" |
| 39 | echo "INFO: create staging directory $repo_iso_dir" |
| 40 | mkdir -p "$repo_iso_dir" |
| 41 | |
| 42 | # Expect ISO file: oran-image-inf-host-intel-x86-64.iso |
| 43 | # in build subdir: workspace/prj_oran-inf/tmp-glibc/deploy/images/intel-x86-64/ |
Bin Yang | 76b5afb | 2020-06-04 05:10:19 +0000 | [diff] [blame] | 44 | #iso="workspace/prj_oran-inf/tmp-glibc/deploy/images/intel-x86-64/oran-image-inf-host-intel-x86-64.iso" |
| 45 | iso="workspace/prj_oran_inf_anaconda/tmp-glibc/deploy/images/intel-corei7-64/inf-image-aio-installer-intel-corei7-64.iso" |
Lott, Christopher (cl778h) | d59c1b8 | 2019-11-14 09:06:25 -0500 | [diff] [blame] | 46 | echo "INFO: copy $iso to staging directory $repo_iso_dir" |
| 47 | cp "$iso" "$repo_iso_dir" |
| 48 | |
| 49 | cmd="lftools deploy nexus $nexus_repo_url $repo_dir" |
| 50 | echo "INFO: Upload ISO to Nexus: $cmd" |
| 51 | $cmd |
| 52 | |
Bin Yang | 76b5afb | 2020-06-04 05:10:19 +0000 | [diff] [blame] | 53 | echo "--> upload-inf.sh ends" |