Skip to content

Commit 9c9d9e5

Browse files
committed
Merge pull request #167 from CodeNow/README.md
add readme
2 parents f3c31a5 + f04296e commit 9c9d9e5

1 file changed

Lines changed: 95 additions & 1 deletion

File tree

README.md

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,98 @@
11
devops-scripts
22
==============
33

4-
Scripts for managing our deployments.
4+
Scripts for managing our deployments.
5+
6+
# How to Deploy at Runnable
7+
## Setup
8+
9+
Before you can deploy you'll need to install the appropriate tools, scripts, and keys on your local machine.
10+
To do so, execute the following steps:
11+
12+
1. Install Ansible (the deploy automation tool we use to deploy projects to production)
13+
http://docs.ansible.com/intro_installation.html
14+
15+
2. Get the latest devops-scripts (the recipes that we use to deploy various projects)
16+
https://github.com/CodeNow/devops-scripts
17+
18+
3. Change to the devops scripts repo directory and run the following command:
19+
`ln -s /<local-path-to-devops-scripts>/ssh/config ~/.ssh/config`
20+
21+
4. Obtain the “Keys of Power” from someone who can already deploy (ask Anand if you don’t know). Depending on what you want to deploy you'll receive either `Test-runnable.pem`, `oregon.pem`, or both.
22+
23+
5. Move the “Keys of Power” .pem files to your `~/.ssh` directory
24+
25+
At this point you should be capable of deploying;
26+
keep reading to find out how to actually perform a deploy!
27+
28+
## Deploying
29+
30+
### Step 1: Determine the Current Deploy Version
31+
**IMPORTANT:** always pull latest devopts-scripts!!
32+
**IMPORTANT:** Before you deploy a new version of any project make sure to determine which version of the project is currently deployed. This way you can quickly revert to the last stable release if something goes wrong after pushing a new version.
33+
34+
Currently the easiest way to determine the current deploy version is to check the latest tag in the repository you are pushing. Note: If you just tagged a new release this would be the second latest tag.
35+
36+
Once you've found the correct tag, copy it down somewhere that is easily and quickly accessible, then continue your quest of deployment...
37+
38+
### Step 2: Deploy the Project via Ansible
39+
**WARNING:** If you were unable to determine the last deploy tag for a project and cannot revert STOP HERE. Ask someone on the team for help before continuing.
40+
41+
From the devops-script/ansible directory here's how to deploy:
42+
```
43+
ansible-playbook -i ./[stage-hosts, prod-hosts] [appname].yml
44+
```
45+
`stage-hosts` is to deploy to staging, `prod-hosts` is to deploy to production
46+
`appname` is what you want to deploy
47+
this command builds and deploys master branch
48+
49+
```
50+
ansible-playbook -i ./[stage-hosts, prod-hosts] [appname].yml -e git_branch=some_brach_or_tag
51+
```
52+
Use above to deploy a specific tag or branch or release
53+
For tags use: `-e git_branch=v1.9.9`
54+
For branches use: `-e git_branch=that_branch`
55+
For a specific commit use: `-e git_branch=3928745892364578623`
56+
57+
```
58+
ansible-playbook -i ./[stage-hosts, prod-hosts] [appname].yml -t deploy -e git_branch=some_brach_or_tag
59+
```
60+
This will redeploy the current deploy without rebuilding
61+
62+
```
63+
ansible-playbook -i./[stage-hosts, prod-hosts] [appname].yml -e git_branch=some-branch-name -e build_args=”--no-cache”
64+
```
65+
66+
deploy latest version of the branch
67+
68+
## Reverting
69+
70+
If, for some reason, the new deploy is not operating as expected you can quickly revert by referencing the tag you collected in Step 1. Simply run the appropriate deploy command in the previous section with the last release tag and the new deploy will be reverted.
71+
72+
## Deploy Songs
73+
74+
It is the custom at Runnable to play a song to the entire team when deploying. For each of the repositories here are the respective songs:
75+
76+
[api: Push it - Rick Ross](https://www.youtube.com/watch?v=qk2jeE1LOn8)
77+
78+
[runnable-angular: Push it to the limit - Scarface](https://www.youtube.com/watch?v=9D-QD_HIfjA)
79+
80+
[mavis: Fairy Tail theme song](https://www.youtube.com/watch?v=kIwmrk7LoDk)
81+
82+
[khronos: Time After Time - Cyndi Lauper](https://www.youtube.com/watch?v=VdQY7BusJNU)
83+
84+
[navi: Ocarina of Time: Lost Woods The Legend of Zelda](https://www.youtube.com/watch?v=iOGpdGEEcJM)
85+
86+
[optimus: Original Transformers opening theme](https://www.youtube.com/watch?v=nLS2N9mHWaw)
87+
88+
[charon: Enter Sandman - Metallica](https://www.youtube.com/watch?v=CD-E-LDc384)
89+
90+
[docker listener: Call Me Maybe - Carly Rae Jepsen](https://www.youtube.com/watch?v=fWNaR-rxAic)
91+
92+
[krain: men at work - down under](https://www.youtube.com/watch?v=XfR9iY5y94s)
93+
94+
[filibuster: He's a Pirate - Pirates Of The Caribbean](https://www.youtube.com/watch?v=yRh-dzrI4Z4)
95+
96+
[shiva: FFXIV Shiva Theme](https://www.youtube.com/watch?v=noJiH8HLZw4)
97+
98+
**IMPORTANT:** Make sure the play the song loud and proud when deploying!

0 commit comments

Comments
 (0)