Consume snapcraft config and mattermost webhook

This commit is contained in:
Adrien Ferrand 2020-06-26 21:07:36 +02:00
parent d220f5c3e7
commit f8add8d502
2 changed files with 7 additions and 3 deletions

View file

@ -15,8 +15,12 @@ jobs:
artifact: snap
path: $(Build.SourcesDirectory)/snap
displayName: Retrieve Certbot snap
- task: DownloadSecureFile@1
name: snapcraftCfg
inputs:
secureFile: snapcraft.cfg
- bash: |
mkdir .snapcraft
echo $(SNAPCRAFT_LOGIN_FILE) | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg
mkdir -p .snapcraft
ln -s .snapcraft/snapcraft.cfg $(snapcraftCfg.secureFilePath)
snapcraft push --release=edge snap/*.snap
displayName: Publish to Snap store

View file

@ -9,5 +9,5 @@ stages:
steps:
- bash: |
MESSAGE="---\n##### Azure Pipeline - Pipeline: $(Build.DefinitionName) - Build: $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---"
curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data "{\"channel_id\":\"$(MATTERMOST_CHANNEL_ID)\",\"message\":\"${MESSAGE}\"}" -X POST "$(MATTERMOST_URL)/api/v4/posts"
curl -i -X POST --data-urlencode 'payload={"text":"${MESSAGE}"}' "$(MATTERMOST_URL)"
condition: failed()