Last active
December 30, 2019 10:04
-
-
Save christopher-paul-shaw/96dcda216f79b2dea62180ecfb9879e0 to your computer and use it in GitHub Desktop.
Deployment Script For relocating streamed deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REPONAME=$1 | |
BRANCH=$2 | |
stream_directory=/home/deployment_user/stream_$BRANCH/ | |
deploy_directory=/var/www/qa/$REPONAME/$BRANCH/ | |
if [ $BRANCH == "master" ] | |
then | |
if [ $REPONAME == 'example.com' ] | |
then | |
deploy_directory=/var/www/example.com | |
fi | |
fi | |
mv $stream_directory/repo/* $stream_directory | |
rm -rf $stream_directory/repo/ | |
rm -rf $deploy_directory | |
cp --no-preserve=mode,ownership --recursive $stream_directory $deploy_directory | |
echo "Deployed $REPONAME $BRANCH" | |
rm -rf $stream_directory | |
echo "Removed Directory $stream_directory" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment