Skip to content

Instantly share code, notes, and snippets.

@ygerasimov
Created August 13, 2023 23:07
Show Gist options
  • Save ygerasimov/6fa0ab2a873a16288965752a12687598 to your computer and use it in GitHub Desktop.
Save ygerasimov/6fa0ab2a873a16288965752a12687598 to your computer and use it in GitHub Desktop.
tugboat-diffy-update
services:
apache:
commands:
init:
# The Diffy CLI tool requires PHP. If the service image does not have PHP
# installed, do it here
#- apt-get update
#- apt-get install php-cli
# Download the Diffy CLI tool, and authenticate. The latest version can be
# found at https://github.com/DiffyWebsite/diffy-cli/releases
- curl -L https://github.com/diffywebsite/diffy-cli/releases/latest/download/diffy.phar -o /usr/local/bin/diffy
- chmod +x /usr/local/bin/diffy
- diffy auth:login $DIFFY_API_KEY
# Clean up after apt-get, if it was used
#- apt-get clean
#- rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
online:
# Pass commit hash
LAST_GIT_COMMIT_HASH=$(git log -1 --pretty=%H)
# Compare this service with production
- diffy project:compare $DIFFY_PROJECT_ID prod custom --env2Url=$TUGBOAT_SERVICE_URL --commit-sha="${LAST_GIT_COMMIT_HASH}"
# Compare this service with the base preview
- if [ "x$TUGBOAT_BASE_PREVIEW_URL" != "x" ]; then diffy project:compare $DIFFY_PROJECT_ID custom custom
--env1Url=$TUGBOAT_BASE_PREVIEW_URL --env2Url=$TUGBOAT_SERVICE_URL --commit-sha="${LAST_GIT_COMMIT_HASH}"; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment