Files
Rioting Pacifist b9b3bf572f Initial commit
contains:
* Actual template
* Example function
* Tests
* Integration test (make file)
* Integration tests (deployed as lambda)
* drone CI and CI scripts
2020-03-16 16:33:40 +00:00

18 lines
422 B
Bash

#!/usr/bin/env bash
PROTECTED=master
ENVIRONMENT="${DRONE_BRANCH##*/}"
[ -z "$ENVIRONMENT" ] && ENVIRONMENT="$DRONE_TAG"
if [[ "$ENVIRONMENT" =~ $PROTECTED ]] && [ "$ENVIRONMENT" != "$DRONE_BRANCH" ] ; then
echo "Can only deploy to $PROTECTED from named branches"
unset ENVIRONMENT
fi
if [ -f "environments/${ENVIRONMENT}.env" ] ; then
make all "env=${ENVIRONMENT}"
else
make all env=ci
make delete env=ci
fi