Skip to content

Instantly share code, notes, and snippets.

@speier
Last active December 19, 2015 13:49
Show Gist options
  • Save speier/5964482 to your computer and use it in GitHub Desktop.
Save speier/5964482 to your computer and use it in GitHub Desktop.

Revisions

  1. speier revised this gist Jul 16, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion 3. upstart config
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,8 @@ stop on runlevel [!2345]

    respawn

    env NODE_ENV=production
    env NODE_ENV='production'
    env STAGING='true'

    chdir /home/git/project
    exec /usr/bin/node server.js >> /var/log/project.log 2>&1
  2. speier revised this gist Jul 16, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 3. upstart config
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@ respawn
    env NODE_ENV=production

    chdir /home/git/project
    exec /usr/bin/node server.js > /var/log/project.log 2>&1
    exec /usr/bin/node server.js >> /var/log/project.log 2>&1
  3. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 3. upstart config
    Original file line number Diff line number Diff line change
    @@ -7,5 +7,5 @@ respawn

    env NODE_ENV=production

    cd /home/git/project
    chdir /home/git/project
    exec /usr/bin/node server.js > /var/log/project.log 2>&1
  4. speier revised this gist Jul 15, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion 3. upstart config
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,8 @@ start on runlevel [2345]
    stop on runlevel [!2345]

    respawn


    env NODE_ENV=production

    cd /home/git/project
    exec /usr/bin/node server.js > /var/log/project.log 2>&1
  5. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1. on the server
    Original file line number Diff line number Diff line change
    @@ -17,4 +17,4 @@
    17. `sudo apt-get update`
    18. `sudo apt-get install nodejs`
    19. create upstart script: `sudo nano /etc/init/project.conf` (see contents below)
    20. add developers public key to `~/.ssh/authorized_keys`
    20. add developers public key to `nano ~/.ssh/authorized_keys`
  6. speier revised this gist Jul 15, 2013. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions 1. on the server
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,11 @@
    10. `cd hooks`
    11. `nano post-receive` (see contents below)
    12. `chmod +x post-receive`
    13. install node.js (https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
    14. create upstart script: `sudo nano /etc/init/project.conf` (see contents below)
    15. add developers public key to `~/.ssh/authorized_keys`
    13. `sudo apt-get update`
    14. `sudo apt-get install python-software-properties python g++ make`
    15. `sudo apt-get install software-properties-common`
    16. `sudo add-apt-repository ppa:chris-lea/node.js`
    17. `sudo apt-get update`
    18. `sudo apt-get install nodejs`
    19. create upstart script: `sudo nano /etc/init/project.conf` (see contents below)
    20. add developers public key to `~/.ssh/authorized_keys`
  7. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 3. upstart config
    Original file line number Diff line number Diff line change
    @@ -5,5 +5,5 @@ stop on runlevel [!2345]

    respawn

    chdir /home/git/project
    cd /home/git/project
    exec /usr/bin/node server.js > /var/log/project.log 2>&1
  8. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 2. post-receive
    Original file line number Diff line number Diff line change
    @@ -10,5 +10,6 @@ npm install
    # we have a few private packages on github, without versioning, those needs to be installed by name
    # npm install xy-package

    # trying to stop then start (unfortunately upstart's restart command doesn't have the same behaviour)
    sudo stop project
    sudo start project
  9. speier revised this gist Jul 15, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion 2. post-receive
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,5 @@ npm install
    # we have a few private packages on github, without versioning, those needs to be installed by name
    # npm install xy-package

    sudo restart project
    sudo stop project
    sudo start project
  10. speier revised this gist Jul 15, 2013. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions 4. on my local computer
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,2 @@
    `git remote remove heroku`
    `git remote add production [email protected]:project.git`
    `git push production master`
    `git remote add test [email protected]:project.git`
    `git push test master`
  11. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1. on the server
    Original file line number Diff line number Diff line change
    @@ -12,4 +12,4 @@
    12. `chmod +x post-receive`
    13. install node.js (https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
    14. create upstart script: `sudo nano /etc/init/project.conf` (see contents below)
    15. somehow we need to upload/add developers' public key to `~/.ssh/authorized_keys`
    15. add developers public key to `~/.ssh/authorized_keys`
  12. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1. on the server
    Original file line number Diff line number Diff line change
    @@ -12,4 +12,4 @@
    12. `chmod +x post-receive`
    13. install node.js (https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
    14. create upstart script: `sudo nano /etc/init/project.conf` (see contents below)
    15. somehow we need to upload/add developers' public key to `~/.ssh/authorized_keys` (like [heroku](https://devcenter.heroku.com/articles/keys))
    15. somehow we need to upload/add developers' public key to `~/.ssh/authorized_keys`
  13. speier revised this gist Jul 15, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion 1. on the server
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,5 @@
    11. `nano post-receive` (see contents below)
    12. `chmod +x post-receive`
    13. install node.js (https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
    14. create upstart script: `sudo nano /etc/init/project.conf` (see contents below)
    14. create upstart script: `sudo nano /etc/init/project.conf` (see contents below)
    15. somehow we need to upload/add developers' public key to `~/.ssh/authorized_keys` (like [heroku](https://devcenter.heroku.com/articles/keys))
  14. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 2. post-receive
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,4 @@ npm install
    # we have a few private packages on github, without versioning, those needs to be installed by name
    # npm install xy-package

    restart project
    sudo restart project
  15. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1. on the server
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,4 @@
    11. `nano post-receive` (see contents below)
    12. `chmod +x post-receive`
    13. install node.js (https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
    14. `sudo nano /etc/init/project.conf` (see contents below)
    14. create upstart script: `sudo nano /etc/init/project.conf` (see contents below)
  16. speier revised this gist Jul 15, 2013. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  17. speier revised this gist Jul 15, 2013. 2 changed files with 1 addition and 3 deletions.
    2 changes: 1 addition & 1 deletion 3. on my local computer
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    `git remote remove heroku`
    `git remote add production [email protected]:project.git`
    `git push production master`
    `git push production master`
    2 changes: 0 additions & 2 deletions 4. upstart config
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    # /etc/init/project.conf

    description "project daemon"

    start on runlevel [2345]
  18. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 3. on my local computer
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    `git remote remove heroku`
    `git remote add production [email protected]:project.git`
    `git push production master`
    `git push production master`
  19. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 1. on the server
    Original file line number Diff line number Diff line change
    @@ -11,3 +11,4 @@
    11. `nano post-receive` (see contents below)
    12. `chmod +x post-receive`
    13. install node.js (https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
    14. `sudo nano /etc/init/project.conf` (see contents below)
  20. speier revised this gist Jul 15, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions 4. upstart config
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # /etc/init/project.conf

    description "project daemon"

    start on runlevel [2345]
  21. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1. on the server
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    01. `apt-get install git`
    02. `adduser git`
    03. `visudo` add `git ALL=(ALL:ALL) NOPASSWD: ALL` to "user privilege specification"
    03. `visudo` add `git ALL=(ALL:ALL) NOPASSWD: ALL` to user privilege specification
    04. `login git`
    05. `ssh-keygen -t rsa`
    06. `mkdir project`
  22. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1. on the server
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    01. `apt-get install git`
    02. `adduser git`
    03. `visudo` add `git ALL=(ALL:ALL) NOPASSWD: ALL`
    03. `visudo` add `git ALL=(ALL:ALL) NOPASSWD: ALL` to "user privilege specification"
    04. `login git`
    05. `ssh-keygen -t rsa`
    06. `mkdir project`
  23. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1. on the server
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    01. `apt-get install git`
    02. `adduser git`
    03. `visudo` add `git ALL=(ALL:ALL) ALL`
    03. `visudo` add `git ALL=(ALL:ALL) NOPASSWD: ALL`
    04. `login git`
    05. `ssh-keygen -t rsa`
    06. `mkdir project`
  24. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1. on the server
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    01. `sudo apt-get install git`
    01. `apt-get install git`
    02. `adduser git`
    03. `visudo` add `git ALL=(ALL:ALL) ALL`
    04. `login git`
  25. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 2. post-receive
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ GIT_WORK_TREE=$APP_TREE git checkout -f

    cd $APP_TREE

    npm install --loglevel error
    npm install

    # we have a few private packages on github, without versioning, those needs to be installed by name
    # npm install xy-package
  26. speier revised this gist Jul 15, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 2. post-receive
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ GIT_WORK_TREE=$APP_TREE git checkout -f

    cd $APP_TREE

    npm install
    npm install --loglevel error

    # we have a few private packages on github, without versioning, those needs to be installed by name
    # npm install xy-package
  27. speier revised this gist Jul 11, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1. on the server
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,6 @@
    08. `cd project.git`
    09. `git init --bare`
    10. `cd hooks`
    11. `nano post-receive` (contents see below)
    11. `nano post-receive` (see contents below)
    12. `chmod +x post-receive`
    13. install node.js (https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
  28. speier revised this gist Jul 11, 2013. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions 1. on the server
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    1. `sudo apt-get install git`
    2. `adduser git`
    3. `visudo` add `git ALL=(ALL:ALL) ALL`
    4. `login git`
    5. `ssh-keygen -t rsa`
    6. `mkdir project`
    7. `mkdir project.git`
    8. `cd project.git`
    9. `git init --bare`
    01. `sudo apt-get install git`
    02. `adduser git`
    03. `visudo` add `git ALL=(ALL:ALL) ALL`
    04. `login git`
    05. `ssh-keygen -t rsa`
    06. `mkdir project`
    07. `mkdir project.git`
    08. `cd project.git`
    09. `git init --bare`
    10. `cd hooks`
    11. `nano post-receive` (contents see below)
    12. `chmod +x post-receive`
  29. speier revised this gist Jul 11, 2013. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions 2. post-receive
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,7 @@ cd $APP_TREE

    npm install

    # we have a few private packages on github, without versioning, those needs to be installed by name
    # npm install xy-package

    restart project
  30. speier revised this gist Jul 11, 2013. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions 2. post-receive
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,5 @@ GIT_WORK_TREE=$APP_TREE git checkout -f
    cd $APP_TREE

    npm install
    npm install lunchbunny-assets
    npm install lunchbunny-common
    npm install lunchbunny-config
    npm install lunchbunny-models
    npm install lunchbunny-cart

    restart project