container-tag-method: latest
# maven settings file has docker credentials
mvn-settings: com-log-settings
+ # copy packages to Jenkins filesystem
+ post_docker_build_script: !include-raw-escape:
+ - ../shell/export-packages.sh
jobs:
- # verify only; no merge bcos no image is pushed
+ # TODO: define a merge template to push package, not image
- gerrit-docker-verify
<<: *log_docker_common
project: com/log
project-name: com-log
build-node: centos7-builder-1c-1g
-
jobs:
- gerrit-info-yaml-verify
container-tag-method: latest
# maven settings file has docker credentials
mvn-settings: ric-plt-lib-rmr-settings
- # copy deb to Jenkins filesystem
+ # copy packages to Jenkins filesystem
post_docker_build_script: !include-raw-escape:
- - shell/copy-rmr-packages.sh
+ - ../shell/export-packages.sh
jobs:
# TODO: define a merge template to push package, not image
- gerrit-docker-verify
+++ /dev/null
-#!/bin/bash -l
-# use login flag to get $HOME/.local/bin in PATH
-# bcos pip installs yq to $HOME/.local/bin
-
-#==================================================================================
-# Copyright (c) 2019 Nokia
-# Copyright (c) 2018-2019 AT&T Intellectual Property.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#==================================================================================
-
-set -eux -o pipefail
-echo "--> copy-rmr-packages.sh"
-
-# extracts artifacts created by the builder
-# file with paths of generated deb, rpm packages
-pkgs="build_packages.yml"
-
-# access builder files within a container created by running a trivial command
-# environment variables are injected in previous Jenkins steps
-container=$(docker run -d "$CONTAINER_PUSH_REGISTRY"/"$DOCKER_NAME":"$DOCKER_IMAGE_TAG" ls)
-docker cp "${container}:/tmp/${pkgs}" .
-
-count=$(yq -r '.files | length' $pkgs)
-# modern bash syntax is helpful
-for (( i = 0; i < count; i++ )); do
- file=$(yq -r ".files[$i]" "$pkgs")
- docker cp "$container":"$file" .
- base=$(basename "$file")
- echo "Push file $base" # TODO
-done
--- /dev/null
+#!/bin/bash
+#==================================================================================
+# Copyright (c) 2019 AT&T Intellectual Property.
+# Copyright (c) 2019 Nokia
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#==================================================================================
+
+set -eux -o pipefail
+echo "--> export-packages.sh"
+
+# Launches the docker image, which has an entrypoint script
+# that copies artifacts created by the builder to a directory.
+# Environment variables are injected in previous Jenkins steps.
+HOST=/tmp/export
+GUEST=/export
+mkdir -p "$HOST"
+docker run -v "$HOST":"$GUEST" "$CONTAINER_PUSH_REGISTRY"/"$DOCKER_NAME":"$DOCKER_IMAGE_TAG" "$GUEST"
+ls "$HOST"