From: Lott, Christopher (cl778h) Date: Wed, 12 Jun 2019 18:54:12 +0000 (-0400) Subject: Use yq to extract package paths and copy files X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=ci-management.git;a=commitdiff_plain;h=28b6138af1c97b9ad32206c6966a75f11b7a6fc2 Use yq to extract package paths and copy files RMr now builds both DEB and RPM packages Signed-off-by: Lott, Christopher (cl778h) Change-Id: I558427f289668a5f6d149bc899a5c884f19c1ef4 --- diff --git a/jjb/ric-plt-lib-rmr/ric-plt-lib-rmr.yaml b/jjb/ric-plt-lib-rmr/ric-plt-lib-rmr.yaml index 46e2267b..d1f978a8 100644 --- a/jjb/ric-plt-lib-rmr/ric-plt-lib-rmr.yaml +++ b/jjb/ric-plt-lib-rmr/ric-plt-lib-rmr.yaml @@ -38,8 +38,8 @@ post_docker_build_script: !include-raw-escape: - shell/copy-rmr-packages.sh jobs: - # merge pushes deb, not image - - '{project-name}-gerrit-docker-jobs' + # TODO: define a merge template to push package, not image + - gerrit-docker-verify <<: *rmr_docker_common - project: diff --git a/jjb/ric-plt-lib-rmr/shell/copy-rmr-packages.sh b/jjb/ric-plt-lib-rmr/shell/copy-rmr-packages.sh index e15a1e29..5121abfa 100755 --- a/jjb/ric-plt-lib-rmr/shell/copy-rmr-packages.sh +++ b/jjb/ric-plt-lib-rmr/shell/copy-rmr-packages.sh @@ -19,17 +19,23 @@ set -eux -o pipefail echo "--> copy-rmr-packages.sh" -# extracts to host the artifacts created by the builder +# extracts artifacts created by the builder -# This file is created by RMr library build process -# with path(s) to the generated artifact(s) -file="/tmp/rmr_deb_path" +# file with paths of generated deb, rpm packages +pkgs="/tmp/build_output.yml" -# create a container from the image by running a trivial command +# access builder files by creating a container with a trivial command # environment variables are injected in previous Jenkins steps -container=$(docker run -d "$CONTAINER_PUSH_REGISTRY"/"$DOCKER_NAME":"$DOCKER_IMAGE_TAG" ls "$file") -docker logs "$container" -docker cp "$container:$file" . -filebase=$(basename "$file") -deb=$(cat "$filebase") -docker cp "$container:$deb" . +container=$(docker run -d "$CONTAINER_PUSH_REGISTRY"/"$DOCKER_NAME":"$DOCKER_IMAGE_TAG" ls) +docker cp "$container":"$pkgs" . +pkgs_base=$(basename "$pkgs") + +deb=$(yq -r .deb "$pkgs_base") +docker cp "$container":"$deb" . +deb_base=$(basename "$deb") +echo "Push file $deb_base" # TODO + +rpm=$(yq -r .rpm "$pkgs_base") +docker cp "$container":"$rpm" . +rpm_base=$(basename "$rpm") +echo "Push file $rpm_base" # TODO