You are here

environment-indicator.sh in Environment Indicator 7.2

#!/bin/sh
#
# Cloud Hook: environment-indicator
#
# 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. This hook will
# maintain a variable with the realease information.

site="$1"
target_env="$2"
source_branch="$3"
deployed_tag="$4"
repo_url="$5"
repo_type="$6"

if [ "$source_branch" != "$deployed_tag" ]; then
    drush @$site.$target_env vset --exact environment_indicator_remote_release.$target_env $source_branch
else
    drush @$site.$target_env vset --exact environment_indicator_remote_release.$target_env $deployed_tag
fi
echo "Updated release info for environment indicator."

File

samples/environment-indicator.sh
View source
  1. #!/bin/sh
  2. #
  3. # Cloud Hook: environment-indicator
  4. #
  5. # The post-code-deploy hook is run whenever you use the Workflow page to
  6. # deploy new code to an environment, either via drag-drop or by selecting
  7. # an existing branch or tag from the Code drop-down list. This hook will
  8. # maintain a variable with the realease information.
  9. site="$1"
  10. target_env="$2"
  11. source_branch="$3"
  12. deployed_tag="$4"
  13. repo_url="$5"
  14. repo_type="$6"
  15. if [ "$source_branch" != "$deployed_tag" ]; then
  16. drush @$site.$target_env vset --exact environment_indicator_remote_release.$target_env $source_branch
  17. else
  18. drush @$site.$target_env vset --exact environment_indicator_remote_release.$target_env $deployed_tag
  19. fi
  20. echo "Updated release info for environment indicator."