From fde124cadfca352680864248fe4c0299ff011ac8 Mon Sep 17 00:00:00 2001 From: Drew Reed Date: Wed, 7 Sep 2022 14:45:37 +0000 Subject: [PATCH 1/2] ci: Switch to combined Cancel/Complete jobs Use the new lava templates that combine the Cancel and Complete lava job to reduce the number of jobs triggered per pipeline Signed-off-by: Drew Reed --- .gitlab-ci.yml | 2 +- .gitlab/ci/templates/image_build.yml.j2 | 5 ----- .gitlab/ci/trigger-image-builds.yml | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 932cbb9..7d854c1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,7 @@ variables: # include jobs include: - project: $PIPELINE_TEMPLATE_PROJECT - ref: v0.0.9 + ref: v0.0.10 file: - gitlab-ci/common_gitlab-ci.yml - gitlab-ci/docker-image-base_gitlab-ci.yml diff --git a/.gitlab/ci/templates/image_build.yml.j2 b/.gitlab/ci/templates/image_build.yml.j2 index da2f887..081119e 100644 --- a/.gitlab/ci/templates/image_build.yml.j2 +++ b/.gitlab/ci/templates/image_build.yml.j2 @@ -70,11 +70,6 @@ PTest-{{ CI_JOB_NAME_SLUG }}-Complete: extends: .ptest-tests-results needs: - PTest-{{ CI_JOB_NAME_SLUG }} - -PTest-{{ CI_JOB_NAME_SLUG }}-Cancel: - extends: .cancel-lava-job - needs: - - PTest-{{ CI_JOB_NAME_SLUG }} {% endif %} {% endif %} diff --git a/.gitlab/ci/trigger-image-builds.yml b/.gitlab/ci/trigger-image-builds.yml index f3914b3..bed5e64 100644 --- a/.gitlab/ci/trigger-image-builds.yml +++ b/.gitlab/ci/trigger-image-builds.yml @@ -33,7 +33,7 @@ merge_jobs: cat << EOF > ${CI_JOB_FILE} include: - project: $PIPELINE_TEMPLATE_PROJECT - ref: v0.0.9 + ref: v0.0.10 file: - gitlab-ci/common_gitlab-ci.yml - gitlab-ci/lava-test-base_gitlab-ci.yml -- GitLab From 49fc300a88381d5f64bcb0f24df35c04765afa72 Mon Sep 17 00:00:00 2001 From: Drew Reed Date: Wed, 7 Sep 2022 15:41:40 +0000 Subject: [PATCH 2/2] ci: Switch to GitLab standard variable to control debug output GitLab has a built in variable CI_DEBUG_TRACE that is used to control the amount of debug output logged during pipeline runs. This change uses that to control the additional output we can generate to aid debugging pipelines. Signed-off-by: Drew Reed --- .gitlab-ci.yml | 2 +- .gitlab/ci/n1sdp-image-builds.yml | 2 +- .gitlab/ci/trigger-image-builds.yml | 2 +- .gitlab/ci/yocto-build.yml | 2 +- .gitlab/ci/yocto-qa.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7d854c1..7a3e4cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ --- variables: DOCKER_IMAGE_TAG: $CI_COMMIT_REF_SLUG - DEBUG_PIPELINE: + CI_DEBUG_TRACE: value: 'false' description: Enable debug information output to the log BUILD_IMAGE: diff --git a/.gitlab/ci/n1sdp-image-builds.yml b/.gitlab/ci/n1sdp-image-builds.yml index 6eabab4..217aa34 100644 --- a/.gitlab/ci/n1sdp-image-builds.yml +++ b/.gitlab/ci/n1sdp-image-builds.yml @@ -14,7 +14,7 @@ - export CI_JOB_NAME_SLUG=${CI_JOB_NAME//\//-} - mkdir tmp - j2 .gitlab/ci/templates/image_build.yml.j2 -o tmp/${CI_JOB_NAME_SLUG}.yml; - - if [ "$DEBUG_PIPELINE" == "true" ]; then + - if [ "$CI_DEBUG_TRACE" == "true" ]; then cat tmp/${CI_JOB_NAME_SLUG}.yml; fi needs: diff --git a/.gitlab/ci/trigger-image-builds.yml b/.gitlab/ci/trigger-image-builds.yml index bed5e64..3fd9c23 100644 --- a/.gitlab/ci/trigger-image-builds.yml +++ b/.gitlab/ci/trigger-image-builds.yml @@ -50,7 +50,7 @@ merge_jobs: # Add global variables to env file to export in child pipelines - echo "CREATE_JOB_ID=${CI_JOB_ID}" > global_variables.env - cat global_variables.env - - if [ "${DEBUG_PIPELINE}" == "true" ]; then + - if [ "${CI_DEBUG_TRACE}" == "true" ]; then cat ${CI_JOB_FILE}; fi artifacts: diff --git a/.gitlab/ci/yocto-build.yml b/.gitlab/ci/yocto-build.yml index 920e37f..1696a21 100644 --- a/.gitlab/ci/yocto-build.yml +++ b/.gitlab/ci/yocto-build.yml @@ -45,7 +45,7 @@ $DL_DIR $IMAGE_DIR $TOOLCHAIN_DIR - - if [ "$DEBUG_PIPELINE" == "true" ]; then + - if [ "$CI_DEBUG_TRACE" == "true" ]; then env | sort; fi needs: diff --git a/.gitlab/ci/yocto-qa.yml b/.gitlab/ci/yocto-qa.yml index ce8857e..8ee28fc 100644 --- a/.gitlab/ci/yocto-qa.yml +++ b/.gitlab/ci/yocto-qa.yml @@ -19,7 +19,7 @@ check-layers: DL_DIR: $CACHE_DIR/$CASSINI_RELEASE_ID/yocto-downloads TOOLCHAIN_DIR: $CACHE_DIR/toolchains before_script: - - if [ "$DEBUG_PIPELINE" == "true" ]; then + - if [ "$CI_DEBUG_TRACE" == "true" ]; then env | sort; fi - mkdir -p ~/.ssh -- GitLab