image-tests: don't use random names for CI artifacts

When using random names for artifacts like AWS snapshots, or Azure
images, it becomes hard to clean them up in case of CI failure. See this
issue for more details:
https://github.com/osbuild/osbuild-composer/issues/942

This PR introduces predictable names so that we can easily determine
which artifact belongs to which PR and therefore we can decide to wipe
all resources that are not needed any more.
This commit is contained in:
Martin Sehnoutka 2020-09-08 13:59:14 +02:00 committed by Ondřej Budai
parent e80110a12c
commit 509964bede
5 changed files with 27 additions and 26 deletions

View file

@ -133,6 +133,7 @@ pipeline {
AZURE_CREDS = credentials('azure')
OPENSTACK_CREDS = credentials("psi-openstack-creds")
VCENTER_CREDS = credentials('vmware-vcenter-credentials')
DISTRO_CODE = "fedora31"
}
steps {
unstash 'fedora31'
@ -182,6 +183,7 @@ pipeline {
AZURE_CREDS = credentials('azure')
OPENSTACK_CREDS = credentials("psi-openstack-creds")
VCENTER_CREDS = credentials('vmware-vcenter-credentials')
DISTRO_CODE = "fedora32"
}
steps {
unstash 'fedora32'
@ -246,6 +248,7 @@ pipeline {
OPENSTACK_CREDS = credentials("psi-openstack-creds")
RHN_REGISTRATION_SCRIPT = credentials('rhn-register-script-production')
VCENTER_CREDS = credentials('vmware-vcenter-credentials')
DISTRO_CODE = "rhel8"
}
steps {
unstash 'rhel8cdn'
@ -300,6 +303,7 @@ pipeline {
OPENSTACK_CREDS = credentials("psi-openstack-creds")
RHN_REGISTRATION_SCRIPT = credentials('rhn-register-script-production-beta')
VCENTER_CREDS = credentials('vmware-vcenter-credentials')
DISTRO_CODE = "rhel83"
}
steps {
unstash 'rhel83'

View file

@ -58,7 +58,7 @@ run_test_case () {
AZURE_CREDS=${AZURE_CREDS-/dev/null}
OPENSTACK_CREDS=${OPENSTACK_CREDS-/dev/null}
VCENTER_CREDS=${VCENTER_CREDS-/dev/null}
TEST_CMD="env $(cat $AZURE_CREDS $OPENSTACK_CREDS $VCENTER_CREDS) $TEST_RUNNER -test.v ${IMAGE_TEST_CASES_PATH}/${TEST_CASE_FILENAME}"
TEST_CMD="env $(cat $AZURE_CREDS $OPENSTACK_CREDS $VCENTER_CREDS) CHANGE_ID=$CHANGE_ID BUILD_ID=$BUILD_ID DISTRO_CODE=$DISTRO_CODE $TEST_RUNNER -test.v ${IMAGE_TEST_CASES_PATH}/${TEST_CASE_FILENAME}"
# Run the test and add the test name to the list of passed or failed
# tests depending on the result.