Skip to content

Instantly share code, notes, and snippets.

@pmanijak
Last active August 29, 2015 14:00

Revisions

  1. pmanijak revised this gist Aug 8, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion post-receive
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #!/bin/sh
    #!/bin/bash

    DEPLOY_DIR=/home/ubuntu/apps/circle-blvd
    WORK_DIR=/home/ubuntu/working/circle-blvd
  2. pmanijak revised this gist Aug 8, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions post-receive
    Original file line number Diff line number Diff line change
    @@ -13,4 +13,6 @@ npm install --production

    # Move into production, precariously
    rm -r ${DEPLOY_DIR}/*
    # Move dotfiles, too
    shopt -s dotglob nullglob
    mv ${WORK_DIR}/app/* ${DEPLOY_DIR}
  3. pmanijak revised this gist May 3, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion post-receive
    Original file line number Diff line number Diff line change
    @@ -12,5 +12,5 @@ cd ${WORK_DIR}/app
    npm install --production

    # Move into production, precariously
    rm -rf ${DEPLOY_DIR}/*
    rm -r ${DEPLOY_DIR}/*
    mv ${WORK_DIR}/app/* ${DEPLOY_DIR}
  4. pmanijak renamed this gist May 3, 2014. 1 changed file with 0 additions and 0 deletions.
  5. pmanijak revised this gist May 3, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion .prerequisites
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    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 isn't exactly a best practice, but it is a starting point.
    Things to understand:
    -- This is for people comfortable with technical things
    -- This isn't exactly a best practice, but it is a starting point.
  6. pmanijak revised this gist May 3, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion .prerequisites
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,4 @@
    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
    2. Have a clone of https://github.com/secret-project/circle-blvd on your local machine

    Things to understand: This isn't exactly a best practice, but it is a starting point.
  7. pmanijak renamed this gist May 3, 2014. 1 changed file with 0 additions and 0 deletions.
  8. pmanijak revised this gist May 3, 2014. 5 changed files with 25 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions .prerequisites
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    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
    6 changes: 6 additions & 0 deletions .ssh-config
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # In your .ssh/config file

    Host circle-blvd
    HostName <domain or ip address>
    User ubuntu
    IdentiyFile <path to you your pem key>
    3 changes: 3 additions & 0 deletions Set up auto-deploy of Circle Blvd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    1. Prerequisites (see below)
    2. Set up the server
    3. Set up the client
    7 changes: 7 additions & 0 deletions on client
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # 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
    7 changes: 7 additions & 0 deletions on server
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    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
  9. pmanijak created this gist May 3, 2014.
    16 changes: 16 additions & 0 deletions post-receive
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/bin/sh

    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 -rf ${DEPLOY_DIR}/*
    mv ${WORK_DIR}/app/* ${DEPLOY_DIR}