From 583bfc0b4a822f7853323f25022cfb059e13b50f Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Tue, 20 Jul 2021 12:51:41 +0200 Subject: [PATCH] test/cases/ostree: save build logs and manifests Copy log and manifest for each build to the ci-artifacts/ directory to be stored at the end of the build for troubleshooting. --- test/cases/ostree-ng.sh | 6 ++++-- test/cases/ostree.sh | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/cases/ostree-ng.sh b/test/cases/ostree-ng.sh index 0741efc7a..70c7d5cc4 100755 --- a/test/cases/ostree-ng.sh +++ b/test/cases/ostree-ng.sh @@ -72,6 +72,8 @@ STAGE_REPO_ADDRESS=192.168.200.1 STAGE_REPO_URL="http://${STAGE_REPO_ADDRESS}/repo/" QUAY_REPO_URL="docker://quay.io/osbuild/testing-rhel-edge-push" QUAY_REPO_TAG=$(tr -dc a-z0-9 < /dev/urandom | head -c 4 ; echo '') +ARTIFACTS="ci-artifacts" +mkdir -p "${ARTIFACTS}" # Set up temporary files. TEMPDIR=$(mktemp -d) @@ -106,7 +108,7 @@ esac # Get the compose log. get_compose_log () { COMPOSE_ID=$1 - LOG_FILE=${WORKSPACE}/osbuild-${ID}-${VERSION_ID}-${COMPOSE_ID}.log + LOG_FILE=${ARTIFACTS}/osbuild-${ID}-${VERSION_ID}-${COMPOSE_ID}.log # Download the logs. sudo composer-cli compose log "$COMPOSE_ID" | tee "$LOG_FILE" > /dev/null @@ -115,7 +117,7 @@ get_compose_log () { # Get the compose metadata. get_compose_metadata () { COMPOSE_ID=$1 - METADATA_FILE=${WORKSPACE}/osbuild-${ID}-${VERSION_ID}-${COMPOSE_ID}.json + METADATA_FILE=${ARTIFACTS}/osbuild-${ID}-${VERSION_ID}-${COMPOSE_ID}.json # Download the metadata. sudo composer-cli compose metadata "$COMPOSE_ID" > /dev/null diff --git a/test/cases/ostree.sh b/test/cases/ostree.sh index dbc257266..82727f041 100755 --- a/test/cases/ostree.sh +++ b/test/cases/ostree.sh @@ -99,6 +99,8 @@ TEST_UUID=$(uuidgen) IMAGE_KEY="osbuild-composer-ostree-test-${TEST_UUID}" GUEST_ADDRESS=192.168.100.50 SSH_USER="admin" +ARTIFACTS="ci-artifacts" +mkdir -p "${ARTIFACTS}" # Set up temporary files. TEMPDIR=$(mktemp -d) @@ -114,7 +116,7 @@ SSH_KEY=${OSBUILD_COMPOSER_TEST_DATA}keyring/id_rsa # Get the compose log. get_compose_log () { COMPOSE_ID=$1 - LOG_FILE=${WORKSPACE}/osbuild-${ID}-${VERSION_ID}-${COMPOSE_ID}.log + LOG_FILE=${ARTIFACTS}/osbuild-${ID}-${VERSION_ID}-${COMPOSE_ID}.log # Download the logs. sudo composer-cli compose log "$COMPOSE_ID" | tee "$LOG_FILE" > /dev/null @@ -123,7 +125,7 @@ get_compose_log () { # Get the compose metadata. get_compose_metadata () { COMPOSE_ID=$1 - METADATA_FILE=${WORKSPACE}/osbuild-${ID}-${VERSION_ID}-${COMPOSE_ID}.json + METADATA_FILE=${ARTIFACTS}/osbuild-${ID}-${VERSION_ID}-${COMPOSE_ID}.json # Download the metadata. sudo composer-cli compose metadata "$COMPOSE_ID" > /dev/null