Skip to content
Snippets Groups Projects
Commit 8deb0452 authored by Lorenzo Pagliai's avatar Lorenzo Pagliai
Browse files

[REPORT] Chaange path to changelog and build reports

* Add condition to use public container to store report when a tag
occurs
parent 83904daa
No related branches found
No related tags found
No related merge requests found
...@@ -623,8 +623,11 @@ notify: ...@@ -623,8 +623,11 @@ notify:
echo -e "The changelog can be accessed by clicking on the **Changelog** button." >> Job_message.txt echo -e "The changelog can be accessed by clicking on the **Changelog** button." >> Job_message.txt
echo -e "*We kindly ask developers to check job results so that in case of failures a fix to eventual bugs can be promptly made.*" >> Job_message.txt echo -e "*We kindly ask developers to check job results so that in case of failures a fix to eventual bugs can be promptly made.*" >> Job_message.txt
AZURE_PATH="edgehog/reports"
if [ -n "$CI_COMMIT_TAG" ]; then if [ -n "$CI_COMMIT_TAG" ]; then
tag=${CI_COMMIT_TAG} tag=${CI_COMMIT_TAG}
AZURE_STORAGE_SAS_TOKEN="${AZURE_STORAGE_PUBLIC_SAS_TOKEN}"
AZURE_CONTAINER_NAME="${AZURE_PUBLIC_CONTAINER_NAME}"
else else
tag=$(date +%Y%m%d) tag=$(date +%Y%m%d)
fi fi
...@@ -641,33 +644,33 @@ notify: ...@@ -641,33 +644,33 @@ notify:
--sas-token $AZURE_STORAGE_SAS_TOKEN \ --sas-token $AZURE_STORAGE_SAS_TOKEN \
--container-name $AZURE_CONTAINER_NAME \ --container-name $AZURE_CONTAINER_NAME \
--file Job_report_edgehog_${tag}.txt \ --file Job_report_edgehog_${tag}.txt \
--name Build_reports/Job_report_edgehog_${tag}.txt \ --name ${AZURE_PATH}/Job_report_edgehog_${tag}.txt \
--overwrite --overwrite
az storage blob upload --account-name $AZURE_STORAGE_ACCOUNT \ az storage blob upload --account-name $AZURE_STORAGE_ACCOUNT \
--sas-token $AZURE_STORAGE_SAS_TOKEN \ --sas-token $AZURE_STORAGE_SAS_TOKEN \
--container-name $AZURE_CONTAINER_NAME \ --container-name $AZURE_CONTAINER_NAME \
--file Link_report_edgehog_${tag}.txt \ --file Link_report_edgehog_${tag}.txt \
--name Build_reports/Link_report_edgehog_${tag}.txt \ --name ${AZURE_PATH}/Link_report_edgehog_${tag}.txt \
--overwrite --overwrite
az storage blob upload --account-name $AZURE_STORAGE_ACCOUNT \ az storage blob upload --account-name $AZURE_STORAGE_ACCOUNT \
--sas-token $AZURE_STORAGE_SAS_TOKEN \ --sas-token $AZURE_STORAGE_SAS_TOKEN \
--container-name $AZURE_CONTAINER_NAME \ --container-name $AZURE_CONTAINER_NAME \
--file Changelog_edgehog_${tag}.md \ --file Changelog_edgehog_${tag}.md \
--name Build_reports/Changelog_edgehog_${tag}.md \ --name ${AZURE_PATH}/Changelog_edgehog_${tag}.md \
--overwrite --overwrite
cp .gitlab-ci/notification.json . cp .gitlab-ci/notification.json .
job_report="$(az storage blob url --container-name $AZURE_CONTAINER_NAME --name Build_reports/Job_report_edgehog_${tag}.txt)" job_report="$(az storage blob url --container-name $AZURE_CONTAINER_NAME --name ${AZURE_PATH}/Job_report_edgehog_${tag}.txt)"
job_report="$(echo $job_report | sed -E 's/\s.*$//')" job_report="$(echo $job_report | sed -E 's/\s.*$//')"
jq --arg job_var $job_report '.potentialAction[0].targets[0].uri = $job_var' notification.json > notification_1.json jq --arg job_var $job_report '.potentialAction[0].targets[0].uri = $job_var' notification.json > notification_1.json
link_report="$(az storage blob url --container-name $AZURE_CONTAINER_NAME --name Build_reports/Link_report_edgehog_${tag}.txt)" link_report="$(az storage blob url --container-name $AZURE_CONTAINER_NAME --name ${AZURE_PATH}/Link_report_edgehog_${tag}.txt)"
link_report="$(echo $link_report | sed -E 's/\s.*$//')" link_report="$(echo $link_report | sed -E 's/\s.*$//')"
jq --arg link_var $link_report '.potentialAction[1].targets[0].uri = $link_var' notification_1.json > notification_2.json jq --arg link_var $link_report '.potentialAction[1].targets[0].uri = $link_var' notification_1.json > notification_2.json
changelog_report="$(az storage blob url --container-name $AZURE_CONTAINER_NAME --name Build_reports/Changelog_edgehog_${tag}.md)" changelog_report="$(az storage blob url --container-name $AZURE_CONTAINER_NAME --name ${AZURE_PATH}/Changelog_edgehog_${tag}.md)"
changelog_report="$(echo $changelog_report | sed -E 's/\s.*$//')" changelog_report="$(echo $changelog_report | sed -E 's/\s.*$//')"
jq --arg changelog_var $changelog_report '.potentialAction[2].targets[0].uri = $changelog_var' notification_2.json > notification_3.json jq --arg changelog_var $changelog_report '.potentialAction[2].targets[0].uri = $changelog_var' notification_2.json > notification_3.json
sed -i -E 's/\\"//g' notification_3.json sed -i -E 's/\\"//g' notification_3.json
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment