Skip to content

Instantly share code, notes, and snippets.

@christopher-paul-shaw
Last active December 30, 2019 10:04
Show Gist options
  • Save christopher-paul-shaw/96dcda216f79b2dea62180ecfb9879e0 to your computer and use it in GitHub Desktop.
Save christopher-paul-shaw/96dcda216f79b2dea62180ecfb9879e0 to your computer and use it in GitHub Desktop.
Deployment Script For relocating streamed deployments
#!/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