Use yq to extract package paths and copy files 32/332/1
authorLott, Christopher (cl778h) <cl778h@att.com>
Wed, 12 Jun 2019 18:54:12 +0000 (14:54 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Wed, 12 Jun 2019 18:56:35 +0000 (14:56 -0400)
RMr now builds both DEB and RPM packages

Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
Change-Id: I558427f289668a5f6d149bc899a5c884f19c1ef4

jjb/ric-plt-lib-rmr/ric-plt-lib-rmr.yaml
jjb/ric-plt-lib-rmr/shell/copy-rmr-packages.sh

index 46e2267..d1f978a 100644 (file)
@@ -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:
index e15a1e2..5121abf 100755 (executable)
 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