2016-03-03 17:21:24 +01:00
|
|
|
#!/usr/bin/env bash
|
2018-02-02 13:09:32 +01:00
|
|
|
#
|
|
|
|
# Required global environment variables:
|
|
|
|
#
|
|
|
|
# AWS_ACCESS_KEY_ID
|
|
|
|
# AWS_SECRET_ACCESS_KEY
|
|
|
|
# AWS_DEFAULT_REGION
|
|
|
|
#
|
2016-03-03 17:21:24 +01:00
|
|
|
|
|
|
|
set -e;
|
|
|
|
|
2016-06-23 16:23:53 +02:00
|
|
|
##
|
|
|
|
## check for pull request against master
|
|
|
|
##
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
|
|
|
|
|
2020-05-25 13:27:15 +02:00
|
|
|
npm run deploy:staging;
|
2016-06-23 16:23:53 +02:00
|
|
|
|
|
|
|
##
|
|
|
|
## check for master push which is no pull request
|
|
|
|
##
|
|
|
|
elif [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
|
|
|
|
2020-05-25 13:27:15 +02:00
|
|
|
npm run deploy;
|
2016-06-23 16:23:53 +02:00
|
|
|
|
2016-03-03 17:46:59 +01:00
|
|
|
else
|
2016-06-23 16:23:53 +02:00
|
|
|
|
2018-02-02 13:09:32 +01:00
|
|
|
echo "$(tput setaf 64)---------------------------------------------"
|
2016-06-23 16:23:53 +02:00
|
|
|
echo " ✓ nothing to deploy "
|
2018-02-02 13:09:32 +01:00
|
|
|
echo "---------------------------------------------$(tput sgr0)"
|
2016-06-23 16:23:53 +02:00
|
|
|
|
2016-03-03 17:21:24 +01:00
|
|
|
fi;
|
|
|
|
|
2018-02-02 13:09:32 +01:00
|
|
|
echo "$(tput setaf 64)---------------------------------------------"
|
2016-06-23 16:23:53 +02:00
|
|
|
echo " ✓ done deployment "
|
2018-02-02 13:09:32 +01:00
|
|
|
echo "---------------------------------------------$(tput sgr0)"
|
2016-06-23 16:23:53 +02:00
|
|
|
|
2016-03-03 17:21:24 +01:00
|
|
|
exit;
|