This repository has been archived by the owner on Sep 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make dev docker tag changes * [ci skip] auto patch increment skip-checks: true * finish hooks and add chatops * finish hooks and add chatops Co-authored-by: ras-rm-bot <[email protected]>
- Loading branch information
1 parent
6a1566e
commit 6c56862
Showing
3 changed files
with
79 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: comment | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
env: | ||
IMAGE: notify-gateway | ||
SPINNAKER_TOPIC: ${{ secrets.SPINNAKER_TOPIC }} | ||
ARTIFACT_BUCKET: ${{ secrets.ARTIFACT_BUCKET }} | ||
HOST: ${{ secrets.GOOGLE_PROJECT_ID }} | ||
|
||
jobs: | ||
comment: | ||
runs-on: ubuntu-latest | ||
if: contains(github.event.comment.body, '/deploy') | ||
steps: | ||
- name: set namespace | ||
run: | | ||
echo ::set-env name=NAMESPACE::$(echo ${{ github.event.comment.body }} | cut -d' ' -f2) | ||
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master | ||
with: | ||
version: '270.0.0' | ||
service_account_key: ${{ secrets.GCR_KEY }} | ||
- run: | | ||
gcloud auth configure-docker | ||
- uses: actions/checkout@v1 | ||
- name: Add commit comment | ||
run: | | ||
jq -nc "{\"body\": \"@${{ github.event.issue.user.login }}, Spinnaker is deploying the PR to your environment\"}" | \ | ||
curl -sL -X POST -d @- \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: token ${{ secrets.BOT_TOKEN }}" \ | ||
"https://api.github.com/repos/$GITHUB_REPOSITORY/issues/${{ github.event.issue.number }}/comments" | ||
- name: Trigger spinnaker | ||
run: | | ||
gcloud pubsub topics publish $SPINNAKER_TOPIC --project $HOST \ | ||
--message "{ \"kind\": \"storage#object\", \"name\": \"$IMAGE/$IMAGE-latest.tgz\", \"bucket\": \"$ARTIFACT_BUCKET\", \"parameters\": { \"tag\": \"pr-${{ github.event.issue.number }}\", \"namespace\": \"${{ env.NAMESPACE }}\", \"cluster\": \"sandbox\", \"actor\": \"$GITHUB_ACTOR\" } }" \ | ||
--attribute ci="actions" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters