Last active
August 29, 2015 14:00
-
-
Save pmanijak/ab5b674d6d15b335d60f to your computer and use it in GitHub Desktop.
Circle Blvd: Deploy with git, precariously: http://circleblvd.org
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
1. Prerequisites (see below) | |
2. Set up the server | |
3. Set up the client |
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
1. Set up Circle Blvd on Ubuntu: https://gist.github.com/exclsr/6cd72c7815e0ea1ab74e | |
2. Have a clone of https://github.com/secret-project/circle-blvd on your local machine | |
Things to understand: | |
-- This is for people comfortable with technical things | |
-- This isn't exactly a best practice, but it is a starting point. |
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
# In your .ssh/config file | |
Host circle-blvd | |
HostName <domain or ip address> | |
User ubuntu | |
IdentiyFile <path to you your pem key> |
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
# Go to your local repo first | |
# Set up an ssh profile | |
git remote add deploy circle-blvd:/home/ubuntu/repos/circle-blvd.git | |
git push deploy +master:refs/heads/master | |
# To use: git push deploy |
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
mkdir -p ~/repos/circle-blvd.git | |
cd repos/circle-blvd.git | |
git init --bare | |
cd | |
chmod +x post-receive | |
cp post-receive ~/repos/circle-blvd.git/hooks/post-receive |
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 | |
DEPLOY_DIR=/home/ubuntu/apps/circle-blvd | |
WORK_DIR=/home/ubuntu/working/circle-blvd | |
mkdir -p $WORK_DIR | |
# Throw away local changes | |
GIT_WORK_TREE=${WORK_DIR} git checkout -f | |
# Get dependencies | |
cd ${WORK_DIR}/app | |
npm install --production | |
# Move into production, precariously | |
rm -r ${DEPLOY_DIR}/* | |
# Move dotfiles, too | |
shopt -s dotglob nullglob | |
mv ${WORK_DIR}/app/* ${DEPLOY_DIR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment