Skip to content

Instantly share code, notes, and snippets.

@wizact
Created July 29, 2018 05:01
Show Gist options
  • Save wizact/27895c1b29ae66ac3d73f32e4b5f8484 to your computer and use it in GitHub Desktop.
Save wizact/27895c1b29ae66ac3d73f32e4b5f8484 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
fix_name() {
DOCKERFILE_NAME="Dockerfile"
if [[ $CIRCLE_BRANCH = 'release' ]]; then
DOCKERFILE_NAME="$DOCKERFILE_NAME.prod";
elif [[ $CIRCLE_BRANCH = 'test.1' ]]; then
DOCKERFILE_NAME="$DOCKERFILE_NAME.test.1"
else
DOCKERFILE_NAME="$DOCKERFILE_NAME.dev"
fi;
mv -f ./$DOCKERFILE_NAME ./Dockerfile
}
fix_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment