upload deployment logs in blobs

This commit is contained in:
Xavier Pillons 2020-09-29 16:03:58 +02:00
Родитель 7884523c5f
Коммит 7317a781bc
2 изменённых файлов: 24 добавлений и 2 удалений

Просмотреть файл

@ -108,8 +108,28 @@ if [[ "$return_code" -ne "0" ]] || [[ "$show_logs" == "true" ]]; then
echo "Dumping logs"
echo "============"
echo ""
cat $tmp_dir/install/*.log
grep -A4 "\[FAILURE\]" $tmp_dir/install/*.log
#cat $tmp_dir/install/*.log
grep -A10 "\[FAILURE\]" $tmp_dir/install/*.log
echo "===================="
echo "Upload logs in blobs"
echo "===================="
echo ""
# in case of errors, upload the logs into blobs
echo "upload $tmp_dir into blobs"
blob="$SYSTEM_DEFINITIONNAME/$SYSTEM_JOBIDENTIFIER/$BUILD_BUILDNUMBER"
account="$AZHPC_LOG_ACCOUNT"
container="pipelines"
saskey=$( \
az storage container generate-sas \
--account-name $account \
--name $container \
--permissions "rlw" \
--start $(date --utc -d "-2 hours" +%Y-%m-%dT%H:%M:%SZ) \
--expiry $(date --utc -d "+1 hour" +%Y-%m-%dT%H:%M:%SZ) \
--output tsv
)
azcopy cp "$tmp_dir" "https://$account.blob.core.windows.net/$container/$blob?$saskey" --recursive=true
fi
if [ "$return_code" -ne "0" ]; then
exit $return_code

Просмотреть файл

@ -20,6 +20,8 @@ pool: Default
variables:
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# storage account to keep deployment logs
azhpc.log_account: azhpctelemetry
# configuration file to use
azhpc.config: experimental/io500_benchmark/hbv2_io500_impi/config-pbs.json
# pipeline directory