Skip to content

Instantly share code, notes, and snippets.

@froboy
Forked from grasmash/ slack_settings
Last active December 5, 2022 09:23
Show Gist options
  • Save froboy/81efc50345c73b959cc9 to your computer and use it in GitHub Desktop.
Save froboy/81efc50345c73b959cc9 to your computer and use it in GitHub Desktop.
Acquia Cloud Slack integration
TOKEN=obfuscation
SLACK_WEBHOOK_URL=https://yoursite.slack.com/services/hooks/incoming-webhook?token=$TOKEN
CLOUD_SITE=1234567
#!/bin/sh
#
# Cloud Hook: post-code-deploy
#
# The post-code-deploy hook is run whenever you use the Workflow page to
# deploy new code to an environment, either via drag-drop or by selecting
# an existing branch or tag from the Code drop-down list. See
# ../README.md for details.
#
# Usage: post-code-deploy site target-env source-branch deployed-tag repo-url
# repo-type
site="$1"
target_env="$2"
source_branch="$3"
deployed_tag="$4"
repo_url="$5"
repo_type="$6"
# Load the Slack webhook URL (which is not stored in this repo).
. $HOME/slack_settings
# Post deployment notice to Slack
curl -X POST --data-urlencode "payload={\"username\": \"Acquia Cloud\", \"text\": \"A new deployment has been made to *$target_env* using tag *$deployed_tag* on <https://insight.acquia.com/cloud/workflow?s=$CLOUD_SITE|Acquia Cloud>.\", \"icon_emoji\": \":information_source:\"}" $SLACK_WEBHOOK_URL
#!/bin/sh
#
# Cloud Hook: post-db-copy
#
# The post-db-copy hook is run whenever you use the Workflow page to copy a
# database from one environment to another. See ../README.md for
# details.
#
# Usage: post-db-copy site target-env db-name source-env
site="$1"
target_env="$2"
db_name="$3"
source_env="$4"
# Load the Slack webhook URL (which is not stored in this repo).
. $HOME/slack_settings
# Post deployment notice to Slack
curl -X POST --data-urlencode "payload={\"username\": \"Acquia Cloud\", \"text\": \"The database *$db_name* has been copied from *$source_env* to *$target_env* on <https://insight.acquia.com/cloud/workflow?s=$CLOUD_SITE|Acquia Cloud>.\", \"icon_emoji\": \":information_source:\"}" $SLACK_WEBHOOK_URL
#!/bin/sh
#
# Cloud Hook: post-files-copy
#
# The post-files-copy hook is run whenever you use the Workflow page to
# copy the files directory from one environment to another. See
# ../README.md for details.
#
# Usage: post-files-copy site target-env source-env
site="$1"
target_env="$2"
source_env="$3"
# Load the Slack webhook URL (which is not stored in this repo).
. $HOME/slack_settings
# Post deployment notice to Slack
curl -X POST --data-urlencode "payload={\"username\": \"Acquia Cloud\", \"text\": \"Files have been copied from *$source_env* to *$target_env* on <https://insight.acquia.com/cloud/workflow?s=$CLOUD_SITE|Acquia Cloud>.\", \"icon_emoji\": \":information_source:\"}" $SLACK_WEBHOOK_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment