blob: 78caaea347775bb590efbd6ed5034e96f37e64ac [file] [log] [blame]
Lott, Christopher (cl778h)162bf7f2019-06-12 22:12:06 -04001#!/bin/bash -l
2# use login flag to get $HOME/.local/bin in PATH
3
Lott, Christopher (cl778h)db2347d2019-06-12 09:53:40 -04004#==================================================================================
5# Copyright (c) 2019 Nokia
6# Copyright (c) 2018-2019 AT&T Intellectual Property.
7#
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19#==================================================================================
20
21set -eux -o pipefail
22echo "--> copy-rmr-packages.sh"
23
Lott, Christopher (cl778h)28b61382019-06-12 14:54:12 -040024# extracts artifacts created by the builder
Lott, Christopher (cl778h)28b61382019-06-12 14:54:12 -040025# file with paths of generated deb, rpm packages
26pkgs="/tmp/build_output.yml"
Lott, Christopher (cl778h)db2347d2019-06-12 09:53:40 -040027
Lott, Christopher (cl778h)28b61382019-06-12 14:54:12 -040028# access builder files by creating a container with a trivial command
Lott, Christopher (cl778h)c1f5d872019-06-12 13:17:21 -040029# environment variables are injected in previous Jenkins steps
Lott, Christopher (cl778h)28b61382019-06-12 14:54:12 -040030container=$(docker run -d "$CONTAINER_PUSH_REGISTRY"/"$DOCKER_NAME":"$DOCKER_IMAGE_TAG" ls)
31docker cp "$container":"$pkgs" .
32pkgs_base=$(basename "$pkgs")
33
Lott, Christopher (cl778h)162bf7f2019-06-12 22:12:06 -040034# pip installs yq to $HOME/.local/bin
Lott, Christopher (cl778h)28b61382019-06-12 14:54:12 -040035deb=$(yq -r .deb "$pkgs_base")
36docker cp "$container":"$deb" .
37deb_base=$(basename "$deb")
38echo "Push file $deb_base" # TODO
39
40rpm=$(yq -r .rpm "$pkgs_base")
41docker cp "$container":"$rpm" .
42rpm_base=$(basename "$rpm")
43echo "Push file $rpm_base" # TODO