-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#158013889 Add slack configuration #1
Open
scott45
wants to merge
28
commits into
AndelaOSP:master
Choose a base branch
from
Beracah-Group:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
b15d78e
ft(scripts): setup k8s helper scritps
29e481d
ft(examples): add example usage script
96ffa24
pull updates
scott45 2cf88b3
add command
scott45 57b3368
add command
scott45 6672289
add command
scott45 ca1cacd
add command
scott45 a38295e
integrate channel require in example
scott45 075b361
add slack integration in deploy script
scott45 ad7d18c
add slack configuration
scott45 e40fa93
add slack configuration
scott45 7678ac6
make changes to slack function
scott45 6cd67cd
make changes to slack function
scott45 7446273
make changes to slack function
scott45 8f31f35
make changes to slack function
scott45 d559beb
make changes to slack function
scott45 5f755e8
make changes to slack function
scott45 69c4f8b
make changes to slack function
scott45 6163a1b
add required env vars
scott45 1a75469
add required env vars
scott45 749fe4e
add required env vars
scott45 04d564f
add required env vars
scott45 a010363
Merge branch 'master' into add-slack-integration
scott45 d9a0b97
Merge pull request #1 from Beracah-Group/add-slack-integration
scott45 dfd517b
Update README.md
scott45 a84b104
Update README.md
scott45 3ee0497
Update README.md
scott45 e7cb2de
Update README.md
scott45 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,2 +1,13 @@ | ||
# bash-helper-modules | ||
Contains Bash scripts helper functions for setup and deployments. | ||
Contains Bash scripts helper functions for k8s & CircleCI setup and deployments. | ||
|
||
file structure | ||
|
||
> example (file) | ||
- deploy | ||
|
||
> docker(image) | ||
- dockerfile | ||
|
||
> k8s (deploy) | ||
- deploy |
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,69 @@ | ||
#!/usr/bin/env bash | ||
|
||
# The setup below is a sample of how this K8s deploy scripts can be used. Modification may be required to fit your specific purpose. | ||
set -eo pipefail | ||
|
||
DEPLOY_SCRIPT_PATH="${HOME}/deploy" | ||
|
||
curl -o $DEPLOY_SCRIPT_PATH https://raw.githubusercontent.com/AndelaOSP/bash-helper-modules/master/k8s/deploy | ||
|
||
source $DEPLOY_SCRIPT_PATH | ||
# add the following environment variables to your ci. Change them according to your cluster requirements | ||
# PRODUCTION_GOOGLE_COMPUTE_ZONE | ||
# STAGING_GOOGLE_COMPUTE_ZONE | ||
# STAGING_CLUSTER_NAME | ||
# PRODUCTION_CLUSTER_NAME | ||
# PROJECT_NAME | ||
# GOOGLE_PROJECT_ID | ||
# GCLOUD_SERVICE_KEY | ||
# DOCKER_REGISTRY | ||
|
||
|
||
GCLOUD_SERVICE_KEY_NAME=gcloud-service-key.json | ||
ALLOWED_DEPLOY_ENVIRONMENTS=('staging', 'production') | ||
|
||
# uncomment require-channel below to enable sending of slack notifications | ||
# require 'CHANNEL' $CHANNEL | ||
# require 'SLACK_HOOK' $SLACK_HOOK | ||
# require 'EMOJI_1' $EMOJI_1 | ||
# require 'EMOJI_2' $EMOJI_2 | ||
# require 'EMOJI_3' $EMOJI_3 | ||
# require 'EMOJI_4' $EMOJI_4 | ||
# require 'EMOJI_5' $EMOJI_5 | ||
# require 'EMOJI_6' $EMOJI_6 | ||
# require 'EMOJI_7' $EMOJI_7 | ||
# require 'EMOJI_8' $EMOJI_8 | ||
# require 'EMOJI_9' $EMOJI_9 | ||
# require 'EMOJI_10' $EMOJI_10 | ||
require 'PRODUCTION_GOOGLE_COMPUTE_ZONE' $PRODUCTION_GOOGLE_COMPUTE_ZONE | ||
require 'STAGING_GOOGLE_COMPUTE_ZONE' $STAGING_GOOGLE_COMPUTE_ZONE | ||
require 'STAGING_CLUSTER_NAME' $STAGING_CLUSTER_NAME | ||
require 'PRODUCTION_CLUSTER_NAME' $PRODUCTION_CLUSTER_NAME | ||
require 'PROJECT_NAME' $PROJECT_NAME | ||
require 'GOOGLE_PROJECT_ID' $GOOGLE_PROJECT_ID | ||
require 'DOCKER_REGISTRY' $DOCKER_REGISTRY | ||
require 'GCLOUD_SERVICE_KEY' $GCLOUD_SERVICE_KEY | ||
|
||
BRANCH_NAME=$CIRCLE_BRANCH | ||
setEnvironment $BRANCH_NAME | ||
isAllowedDeployEnvironment $ENVIRONMENT | ||
|
||
getDeploymentName DEPLOYMENT_NAME | ||
IMAGE_TAG=$(getImageTag $(getCommitHash)) | ||
IMAGE_NAME=$(getImageName) | ||
|
||
main() { | ||
installGoogleCloudSdk | ||
authWithServiceAccount | ||
configureGoogleCloudSdk | ||
loginToContainerRegistry _json_key | ||
buildAndTagDockerImage -f docker/Dockerfile . | ||
publishDockerImage | ||
logoutContainerRegistry $DOCKER_REGISTRY | ||
deployToKubernetesCluster backend | ||
# configureSlackNotifications() | ||
} | ||
|
||
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Add
$USERNAME, $BRANCH_NAME, $CIRCLE_SHA1
as required variables for this function.