-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config for staging cluster (#360)
Add config to create staging image Add config to deploy to staging custer
- Loading branch information
1 parent
4461aab
commit 21eb241
Showing
9 changed files
with
216 additions
and
39 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
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
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
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,54 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
set -o pipefail | ||
|
||
#@--- Fuction to replace varibels for branch staging ---@# | ||
replace_env_varibles() { | ||
if [[ $GITHUB_REF == "refs/heads/staging" ]]; then | ||
export APPLICATION_ENV=${APPLICATION_ENV_STAGING} | ||
fi | ||
} | ||
|
||
|
||
#@--- Function to setup the message to be send ---@# | ||
setup_message() { | ||
if [[ $GITHUB_REF == "refs/heads/dev" ]] || \ | ||
[[ $GITHUB_REF == "refs/heads/staging" ]]; then | ||
if [[ $DEPLOY == "success" ]]; then | ||
echo "++++++++++++ generate deployment message +++++++++++++" | ||
COMMIT_URL="https://github.com/hikaya-io/activity/commit/${TRAVIS_COMMIT}" | ||
DEPLOYMENT_MESSAGE="*Success* :white_check_mark: The following commit was deployed to *_activity ${APPLICATION_ENV}_* by ${EMOJI} \n [Message]: $TRAVIS_COMMIT_MESSAGE \n [Link]: ${COMMIT_URL}" | ||
else | ||
COMMIT_URL="https://github.com/hikaya-io/activity/commit/${TRAVIS_COMMIT}" | ||
DEPLOYMENT_MESSAGE="*Failed* :no_entry: The following commit was unable to deploy to *_activity ${APPLICATION_ENV}_* by ${EMOJI} \n [Message]: $TRAVIS_COMMIT_MESSAGE \n [Link]: ${COMMIT_URL}" | ||
fi | ||
fi | ||
|
||
} | ||
|
||
#@--- Function to send slack notification ---@# | ||
send_slack_notification() { | ||
|
||
echo "++++++++++++ sending slack message +++++++++++++" | ||
echo $DEPLOYMENT_MESSAGE | ||
curl -X POST --data-urlencode \ | ||
"payload={\"channel\": \"${DEPLOYMENT_CHANNEL}\", \"username\": \"DeployNotification\", \"text\": \"${DEPLOYMENT_MESSAGE}\", \"icon_emoji\": \":rocket:\"}" \ | ||
"${SLACK_CHANNEL_HOOK}" | ||
|
||
} | ||
|
||
#@--- Main function ---@# | ||
main() { | ||
#@--- run the replace function ---@# | ||
replace_env_varibles | ||
|
||
#@-- Run the message function ---@# | ||
setup_message | ||
|
||
#@--- Run slack notify function ---@# | ||
send_slack_notification | ||
} | ||
|
||
#@--- Run main function ---@# | ||
main |
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,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set +ex | ||
set -ex | ||
|
||
#@--- install and setup python ---@# | ||
setup_python() { | ||
|
Oops, something went wrong.