2 # use login flag to get $HOME/.local/bin in PATH
3 # bcos pip installs yq to $HOME/.local/bin
5 #==================================================================================
6 # Copyright (c) 2019 Nokia
7 # Copyright (c) 2018-2019 AT&T Intellectual Property.
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
13 # http://www.apache.org/licenses/LICENSE-2.0
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 #==================================================================================
23 echo "--> copy-rmr-packages.sh"
25 # extracts artifacts created by the builder
26 # file with paths of generated deb, rpm packages
27 pkgs="build_packages.yml"
29 # access builder files within a container created by running a trivial command
30 # environment variables are injected in previous Jenkins steps
31 container=$(docker run -d "$CONTAINER_PUSH_REGISTRY"/"$DOCKER_NAME":"$DOCKER_IMAGE_TAG" ls)
32 docker cp "${container}:/tmp/${pkgs}" .
34 count=$(yq -r '.files | length' $pkgs)
35 # modern bash syntax is helpful
36 for (( i = 0; i < count; i++ )); do
37 file=$(yq -r ".files[$i]" "$pkgs")
38 docker cp "$container":"$file" .
39 base=$(basename "$file")
40 echo "Push file $base" # TODO