httpstatuses/deploy.sh

15 lines
595 B
Bash
Raw Normal View History

2015-11-06 23:01:43 +01:00
build="build-${CIRCLE_BUILD_NUM}"
2016-07-27 17:17:27 +02:00
echo "Preparing ${build}"
2015-11-06 23:01:43 +01:00
sudo mkdir ~/${build}
2015-11-08 01:28:14 +01:00
sudo cp -R ~/httpstatuses/build/. ~/${build}
2016-07-27 17:17:27 +02:00
2015-11-06 23:01:43 +01:00
echo "Deploying ${build} to ${DEPLOY_TARGET}"
2016-07-27 17:17:27 +02:00
rsync -r -l ~/${build} ${DEPLOY_TARGET}:${MY_DIRECTORY}
ssh ${DEPLOY_TARGET} "ln -sfn ${MY_DIRECTORY}/${build} ${MY_DIRECTORY}/live"
echo "Build deployed and pushed live"
echo "Creating CloudFront invalidation"
aws configure set preview.cloudfront true
aws cloudfront create-invalidation --distribution-id ${DISTRIBUTION_ID} --paths "/*"
echo "CloudFront invalidation submitted, invalidation will take up to 15 minutes"