From 125fbd79881681e71df4dabc271d742362045a24 Mon Sep 17 00:00:00 2001 From: Lorenzo Pagliai <lorenzo.pagliai@seco.com> Date: Wed, 14 Dec 2022 16:40:48 +0100 Subject: [PATCH] Insert new trigger rule on CI_COMMIT_TAG * Insert trigger rule allowing to build/deploy/notify on tag creation * In deploy-on-tag job the artifacts are uploaded to the official SECO Azure container with dedicated token, stored as 'yocto_ng' group variable * The commit should fix the error in notify job --- manifest-pipeline-yocto.yml | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/manifest-pipeline-yocto.yml b/manifest-pipeline-yocto.yml index 21ce242..99386c0 100644 --- a/manifest-pipeline-yocto.yml +++ b/manifest-pipeline-yocto.yml @@ -14,7 +14,7 @@ variables: # The id of the gitlab project used in the rules section to not run pipelines in # forked projects. Using variable here, to allow override in other projects including # this file. - #MANIFEST_PROJECT_ID: 2307 + MANIFEST_PROJECT_ID: 2307 # In the manifest, the remotes are specified by an identifier. This is used to find # out included projects for the retrigger job. In custom manifests, the remote may be @@ -50,6 +50,7 @@ workflow: - if: $CI_PIPELINE_SOURCE == "pipeline" - if: $CI_PIPELINE_SOURCE == "web" - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_TAG # Do not run pipelines for merge requests - if: $CI_MERGE_REQUEST_IID when: never @@ -71,7 +72,9 @@ workflow: - if: $CI_PIPELINE_SOURCE == "api" - if: $CI_PIPELINE_SOURCE == "pipeline" - if: $CI_PIPELINE_SOURCE == "web" - # Trigger the pipeline on schedule basis (for weekly release) + - if: $CI_COMMIT_TAG + # Trigger the pipeline on schedule basis (for weekly release) + - if: $CI_PIPELINE_SOURCE == "schedule" stage: manifest-pipeline @@ -130,10 +133,6 @@ retrigger: extends: - .infrastructure - .full_build_pipeline - rules: - #Do not run on schedule - - if: $CI_PIPELINE_SOURCE == "schedule" - when: never stage: retrigger rules: - if: $CI_PIPELINE_SOURCE == "pipeline" @@ -157,8 +156,9 @@ retrigger: - .full_build_pipeline rules: - if: $CI_PIPELINE_SOURCE == "pipeline" - when: manual + when: "manual" - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_TAG stage: build timeout: !reference [variables, BUILD_TIMEOUT] image: @@ -239,14 +239,24 @@ retrigger: cache: {} retry : 2 timeout: 20 m + tags: + - azure_deploy rules: # Trigger deploy jobs only on a schedule basis (for weekly release) - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_TAG script: - BASE_DIRECTORY=$PWD - echo "Deploying packages..." - ART_PATH=$(cat pathname.txt) - DEPLOY_DATE=$(date +%Y%m%d) + - | + if [ -n "$CI_COMMIT_TAG" ]; then + TAG_NAME=${CI_COMMIT_TAG} + AZURE_STORAGE_SAS_TOKEN="${AZURE_STORAGE_PUBLIC_SAS_TOKEN}" + AZURE_CONTAINER_NAME="${AZURE_PUBLIC_CONTAINER_NAME}" + AZURE_PATH="${AZURE_PATH}/edgehog/" + fi - | uboot_filename="seco_edgehog_"$PROCESSOR"_"$BOARD"_uboot_"$KERNEL"_"$TAG_NAME"_"$DEPLOY_DATE".tar.gz" uboot_filename_latest="seco_edgehog_"$PROCESSOR"_"$BOARD"_uboot_"$KERNEL"_"$TAG_NAME"_latest.tar.gz" @@ -269,7 +279,7 @@ retrigger: echo $ART_PATH ls -la $ART_PATH find $ART_PATH -iname $UBOOT_FILE -exec cp -L {} $BASE_DIRECTORY/ \; - echo "$UBOOT_FILE" + echo "${UBOOT_FILE}" ls -la tar -czvf $BASE_DIRECTORY/$uboot_filename -C $BASE_DIRECTORY $UBOOT_FILE ls -la @@ -461,15 +471,16 @@ retrigger: notify: stage: notify - extends: - - .infrastructure image: name: mcr.microsoft.com/azure-cli entrypoint: [""] + tags: + - send_notify allow_failure: true rules: # Trigger deploy jobs only on a schedule basis (for weekly release) - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_TAG script: - | echo -e "The job results for all boards are listed below (also available by clicking on the **Job Report** button)." >> Job_message.txt -- GitLab