Created
November 7, 2009 18:47
-
-
Save subbu/228836 to your computer and use it in GitHub Desktop.
This file contains 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 | |
#Assuming we are deploying to a intranet. Otherwise replace the below IP to actual address. | |
[email protected].$1 | |
echo 'Deploying to $server' | |
ssh $server ' | |
deploy_to=/home/deploy/builds && | |
cd $deploy && | |
echo "Creating deployment folders in $PWD" && | |
mkdir -p $deploy_to/releases && | |
mkdir -p $deploy_to/shared/wp-config && | |
echo "Successfully created deployment setup. Copy wordpress config files to $deploy_to/shared/wp-config and phpmyadmin to $deploy_to/shared ." | |
' |
This file contains 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 | |
if [ $1 -eq 224 ] ; then | |
ssh [email protected] ' | |
echo "Deploying to 224 server" && | |
repos=/home/deploy/repos && | |
builds=/home/deploy/builds && | |
curdate=$(date +"%Y%m%d%H%M%S") && | |
cd $builds/releases && | |
echo "In $PWD" && | |
mkdir -p $curdate && | |
cd $curdate && | |
echo "In $PWD" && | |
echo "Fetching git repo..." && | |
git clone $repos/portals && | |
cd portals/public && | |
echo "Copying config files..." && | |
cp $builds/shared/wp-config/* . && | |
echo "Linking shared files/folders" && | |
ln -s $builds/shared/blogs.dir wp-content/blogs.dir && | |
ln -s $builds/shared/uploads wp-content/uploads && | |
echo "Getting laconica..." && | |
git clone $repos/laconica && | |
echo "Symlinking phpmyadmin..." && | |
ln -s $builds/shared/phpmyadmin phpmyadmin && | |
rm -f ../../../current && | |
ln -s $PWD ../../../current && | |
echo "Successfully deployed" || | |
echo "Deployment failed. Reverting..." && | |
rm -rf $builds/releases/$curdate | |
' | |
else | |
ssh [email protected] ' | |
echo "Deploying to 232 server..." | |
echo "Follow the same steps as above and customize according to this servers needs....." | |
' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment