This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Call add-commit-comment script via --notify option of create:env. (#45)
- Loading branch information
1 parent
7b22566
commit 7f15cf3
Showing
2 changed files
with
17 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
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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
#!/bin/bash | ||
|
||
project="$1" | ||
sha="$2" | ||
comment="$3" | ||
site_url="$4" | ||
|
||
token="$(composer config --global github-oauth.github.com)" | ||
|
||
# Exit immediately on errors | ||
set -e | ||
|
||
# Support for multiple CI platforms | ||
CI_BUILD_REF=${CI_BUILD_REF:-$CIRCLE_SHA1} | ||
if [ -n "$site_url" ] ; then | ||
visit_site="[![Visit Site](https://raw.githubusercontent.com/pantheon-systems/ci-drops-8/0.1.0/data/img/visit-site-36.png)]($site_url)" | ||
fi | ||
|
||
SITE_ID=$(terminus site:info $TERMINUS_SITE --field=id) | ||
DASHBOARD="https://dashboard.pantheon.io/sites/$SITE_ID#$TERMINUS_ENV" | ||
comment="Created multidev environment [$TERMINUS_SITE#$TERMINUS_ENV]($DASHBOARD)." | ||
visit_site="[![Visit Site](https://raw.githubusercontent.com/pantheon-systems/ci-drops-8/0.1.0/data/img/visit-site-36.png)](https://$TERMINUS_ENV-$TERMINUS_SITE.pantheonsite.io/)" | ||
if [ -n "$token" ] ; then | ||
curl -d '{ "body": "'"$comment\\n\\n$visit_site"'" }' -X POST https://api.github.com/repos/$project/commits/$sha/comments?access_token=$token | ||
|
||
if [ -n "$GITHUB_TOKEN" ] ; then | ||
curl -d '{ "body": "'"$comment\\n\\n$visit_site"'" }' -X POST https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/commits/$CIRCLE_SHA1/comments?access_token=$GITHUB_TOKEN | ||
echo $comment | ||
echo | ||
echo $visit_site | ||
fi | ||
|
||
echo $comment | ||
echo | ||
echo $visit_site |
7f15cf3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created multidev environment ci-example-d8-composer#ci-286.
7f15cf3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created multidev environment ci-example-d8-composer#ci-288.
7f15cf3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created multidev environment ci-example-d8-composer#ci-289.