Обновить .gitea/workflows/wf_full_p10.yaml

This commit is contained in:
2024-04-16 18:47:15 +03:00
parent da897f1524
commit a021602815

View File

@ -54,7 +54,7 @@ jobs:
- name: Run building script
id: build-script
run: |
build_args="-b $BR -i alt/distroless-true"
build_args="-b $BR -i alt/base"
#-o $ORG --skip-images alt/distroless-devel
if [[ $BR == 'sisyphus' ]]; then build_args="$build_args --skip-arches arm"; fi
if [[ $ORG == 'k8s' ]]; then build_args="$build_args --overwrite-organization $ORG-$BR"; fi
@ -122,30 +122,30 @@ jobs:
echo "podman rmi --all"; \
podman rmi --all; \
if [ "$haserr" = true ]; then if [[ $(cat $IM.log) != '' ]]; \
then errors="$errors; TEST ERROR OF IMAGE $IM: $(cat $IM.log)"; \
else errors="$errors; TEST ERROR OF IMAGE $IM: test returned empty error, but exit status was nozero"; \
then errors="TEST ERROR OF IMAGE $IM: $(cat $IM.log); $errors"; \
else errors="TEST ERROR OF IMAGE $IM: test returned empty error, but exit status was nozero; $errors"; \
fi; \
fi; \
haserr=false; \
done
echo "ERR=$errors"
echo "ERR=$errors" >> ${GITHUB_ENV}
echo "test process finished"
echo "$errors"
if [[ $errors != '' ]]; then haserr=true; fi
echo "ERR=$haserr" >> ${GITHUB_ENV}
echo "test process finished"
env:
BR: ${{ needs.build-process.outputs.branch }}
ORG: ${{ needs.build-process.outputs.org }}
URL: ${{ needs.build-process.outputs.url }}
REPO: ${{ needs.build-process.outputs.repo }}
- name: Send notification if test crashed
if: ${{ env.ERR != '' || steps.test-script.outcome == 'failure' }}
if: ${{ env.ERR = 'true' || steps.test-script.outcome == 'failure' }}
run: |
issueid=$(curl -X 'GET' "$URL/api/v1/repos/$REPO/gitea-image-forge/issues?state=all&type=issues&page=1&limit=1&token=$T" -H 'accept: application/json' -s | jq '.[].number' -r)
body="Testing images finish with some errors. $ER"
body="Testing images finish with some errors."
curl -X 'POST' "$URL/api/v1/repos/$REPO/gitea-image-forge/issues/$issueid/comments?token=$T" -H 'accept: application/json' -H 'Content-Type: application/json' -d "{ \"body\": \"$body\" }" -s
echo "notification about test error is sent to issue $issueid"
env:
T: ${{ secrets.TOKEN }}
BR: ${{ needs.build-process.outputs.branch }}
URL: ${{ gitea.server_url }}
REPO: ${{ needs.build-process.outputs.repo }}
ER: ${{ env.ERR }}
REPO: ${{ needs.build-process.outputs.repo }}