Skip to content

Commit b8d0ef7

Browse files
committed
Merge pull request #289 from CodeNow/readme-updates
Readme Housekeeping
2 parents f069bbd + f4b8518 commit b8d0ef7

File tree

1 file changed

+90
-61
lines changed

1 file changed

+90
-61
lines changed

README.md

Lines changed: 90 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -22,91 +22,120 @@ https://github.com/CodeNow/devops-scripts
2222

2323
5. Move the “Keys of Power” .pem files to your `~/.ssh` directory
2424

25-
At this point you should be capable of deploying;
26-
keep reading to find out how to actually perform a deploy!
25+
At this point you should be capable of deploying; keep reading to find out how to actually perform a deploy!
2726

28-
## Deploying
27+
## Deploying Services
28+
- **IMPORTANT:** always pull latest devopts-scripts (`git pull origin master`)
29+
- **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.
2930

3031
### 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.
32+
To determine the latest deploy tag for a project please check the project's repository on
33+
github and look for the latest release tag (should be in the form `vX.Y.Z`). Once you've located the tag,
34+
copy it down somewhere that is easily and quickly accessible (you may need to use it quickly if something goes wrong).
3335

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.
36+
### Step 2: Deploy the Project via `ansible-playbook`
3537

36-
Once you've found the correct tag, copy it down somewhere that is easily and quickly accessible, then continue your quest of deployment...
38+
- **WARNING:** If you were unable to determine the last deploy tag for a project and cannot revert **STOP**.
39+
Ask someone on the team for help before continuing.
40+
- **IMPORTANT:** All commands should be run from the `devops-script/ansible` directory.
3741

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.
42+
#### Latest Tag
43+
Build and deploy a service to the latest tag of its repository. This will build
44+
the docker image needed to run the container on our infrastructure.
4045

41-
From the devops-script/ansible directory here's how to deploy:
46+
##### Command
4247
```
43-
ansible-playbook -i ./[stage-hosts, prod-hosts] [appname].yml
48+
ansible-playbook -i ./[inventory_dir] [service-playbook]
4449
```
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
4850

51+
##### Arguments
52+
- `[inventory_dir]` - The environment inventory files (servers and variables). Should be one of the following:
53+
- `stage-hosts` - Runnable sandbox staging environment services
54+
- `gamma-hosts` - Gamma services (internal use only; production mirror)
55+
- `delta-hosts` - Delta services (real production)
56+
- `[service-playbook]` - The playbook for the service you wish to deploy, ex:
57+
- `api.yml` - Deploys both the api and the api-workers services
58+
- `shiva.yml` - Deploys the shiva micro-service
59+
- `charon.yml` - Deploys a specific version of charon DNS to all docks
60+
61+
#### Branch or Tag
62+
Build and deploy a service to a specific branch or tag on its repository. This performs a build
63+
of the docker image needed to run the service on our architecture.
64+
65+
##### Command
4966
```
50-
ansible-playbook -i ./[stage-hosts, prod-hosts] [appname].yml -e git_branch=some_brach_or_tag
67+
ansible-playbook -i ./[inventory_dir] [service-playbook] -e git_branch=[branch-or-tag]
5168
```
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`
5669

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:
70+
##### Arguments
71+
- `[inventory_dir]` - The environment inventory files (servers and variables).
72+
- `[service-playbook]` - The playbook for the service you wish to deploy.
73+
- `[branch-or-tag]` - The branch or tag you wish to deploy, ex:
74+
- `-e git_branch=v1.9.9` (version tag)
75+
- `-e git_branch=my-feature-branch` (branch)
76+
- `-e git_branch=3928745892364578623` (specific commit)
7577

76-
*NEW JUAREZ* [stack: The Cleveland Orchestra (George Szell conducting) Ludwig von Beethoven Symphony No. 9 "Chorale (Ode To Joy)" Opus 125 IV. Presto; Allegro molto assai (Alla marcia); Andante maestroso; Allegro energico, sempre ben marcato.] (https://www.youtube.com/watch?v=4g5770gaais)
7778

78-
[api: Push it - Rick Ross](https://www.youtube.com/watch?v=qk2jeE1LOn8)
79+
#### Redeploy Tag or Branch (No Build)
80+
Redeploy the given tag or branch without building the docker image. This is useful for when a redeploy
81+
is required, but it is of an already built image (e.g. when a service runs out of memory).
7982

80-
[runnable-angular: Push it to the limit - Scarface](https://www.youtube.com/watch?v=9D-QD_HIfjA)
81-
82-
[mavis: Fairy Tail theme song](https://www.youtube.com/watch?v=R4UFCTMrV-o)
83-
84-
[khronos: Time After Time - Cyndi Lauper](https://www.youtube.com/watch?v=VdQY7BusJNU)
85-
86-
[navi: Ocarina of Time: Lost Woods The Legend of Zelda](https://www.youtube.com/watch?v=iOGpdGEEcJM)
87-
88-
[optimus: Original Transformers opening theme](https://www.youtube.com/watch?v=nLS2N9mHWaw)
89-
90-
[charon: Enter Sandman - Metallica](https://www.youtube.com/watch?v=CD-E-LDc384)
83+
##### Command
84+
```
85+
ansible-playbook -i ./[inventory_dir] [service-playbook] -t deploy -e git_branch=[branch-or-tag]
86+
```
9187

92-
[docker listener: Call Me Maybe - Carly Rae Jepsen](https://www.youtube.com/watch?v=fWNaR-rxAic)
88+
##### Arguments
89+
- `[inventory_dir]` - The environment inventory files (servers and variables).
90+
- `[service-playbook]` - The playbook for the service you wish to deploy.
91+
- `[branch-or-tag]` - The branch or tag you wish to deploy.
9392

94-
[krain: men at work - down under](https://www.youtube.com/watch?v=XfR9iY5y94s)
93+
##### Rebuild and Deploy Tag or Branch (No Cache)
94+
Forces a rebuild of a docker image for the given service at the given branch or tag and then deploys the
95+
newly created image. This is useful when a previously deployed branch has new changes that need to
96+
be deployed to an environment.
9597

96-
[filibuster: He's a Pirate - Pirates Of The Caribbean](https://www.youtube.com/watch?v=yRh-dzrI4Z4)
98+
Generally this command is only used with `gamma-hosts/` as it is often used to update code
99+
being tested in the production mirror.
97100

98-
[shiva: FFXIV Shiva Theme](https://www.youtube.com/watch?v=noJiH8HLZw4)
101+
##### Command
102+
```
103+
ansible-playbook -i ./[inventory_dir] [service-playbook] -e git_branch=[branch-or-tag] -e build_args=--no-cache
104+
```
99105

100-
[swarm-manager: Eric Prydz VS Pink Floyd - 'Proper Education'](https://www.youtube.com/watch?v=IttkDYE33aU)
106+
##### Arguments
107+
- `[inventory_dir]` - The environment inventory files (servers and variables).
108+
- `[service-playbook]` - The playbook for the service you wish to deploy.
109+
- `[branch-or-tag]` - The branch or tag you wish to deploy.
101110

102-
[swarm-deamon: Pink Floyd - Another Brick In The Wall](https://www.youtube.com/watch?v=5IpYOF4Hi6Q)
103111

104-
[vault / vault-values: Seal - Kiss From A Rose](https://www.youtube.com/watch?v=zP3so2hY4CM)
112+
## Reverting
113+
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.
114+
Simply run the appropriate deploy command in the previous section with the last release tag and the new deploy will be reverted.
105115

106-
[Sauron: Sauron theme song from LOTR](https://www.youtube.com/watch?v=V_rk9VBrXMY)
116+
## Deploy Songs
107117

108-
[Detention: Unbreakable Kimmy Schmidt](https://youtu.be/CV9xF8CjhJk?t=21s)
118+
- **IMPORTANT:** Make sure to play the song loud and proud when deploying!
109119

110-
[Link: Zelda Main Theme Song](https://www.youtube.com/watch?v=cGufy1PAeTU)
120+
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:
111121

112-
**IMPORTANT:** Make sure to play the song loud and proud when deploying!
122+
| Service | Deploy Song Link |
123+
| ------- | ---------------- |
124+
| api / api-workers | [Push it - Rick Ross](https://www.youtube.com/watch?v=qk2jeE1LOn8) |
125+
| charon | [Enter Sandman - Metallica](https://www.youtube.com/watch?v=CD-E-LDc384) |
126+
| detention | [Unbreakable Kimmy Schmidt](https://youtu.be/CV9xF8CjhJk?t=21s) |
127+
| docker-listener | [Call Me Maybe - Carly Rae Jepsen](https://www.youtube.com/watch?v=fWNaR-rxAic) |
128+
| filibuster | [He's a Pirate - Pirates Of The Caribbean](https://www.youtube.com/watch?v=yRh-dzrI4Z4) |
129+
| khronos | [Time After Time - Cyndi Lauper](https://www.youtube.com/watch?v=VdQY7BusJNU) |
130+
| krain | [Men at Work - Down Under](https://www.youtube.com/watch?v=XfR9iY5y94s) |
131+
| link | [Zelda Main Theme Song](https://www.youtube.com/watch?v=cGufy1PAeTU) |
132+
| mavis | [Fairy Tail theme song](https://www.youtube.com/watch?v=R4UFCTMrV-o) |
133+
| navi | [Ocarina of Time: Lost Woods The Legend of Zelda](https://www.youtube.com/watch?v=iOGpdGEEcJM) |
134+
| optimus | [Original Transformers Opening Theme](https://www.youtube.com/watch?v=nLS2N9mHWaw) |
135+
| runnable-angular | [Push it to the limit - Scarface](https://www.youtube.com/watch?v=9D-QD_HIfjA) |
136+
| sauron | [Sauron theme song from LOTR](https://www.youtube.com/watch?v=V_rk9VBrXMY) |
137+
| shiva | [FFXIV Shiva Theme](https://www.youtube.com/watch?v=noJiH8HLZw4) |
138+
| swarm-deamon | [Pink Floyd - Another Brick In The Wall](https://www.youtube.com/watch?v=5IpYOF4Hi6Q) |
139+
| swarm-manager | [Eric Prydz VS Pink Floyd - 'Proper Education'](https://www.youtube.com/watch?v=IttkDYE33aU) |
140+
| vault / vault-values | [Seal - Kiss From A Rose](https://www.youtube.com/watch?v=zP3so2hY4CM) |
141+
| Full Stack Deploy (`all.yml`) | [The Cleveland Orchestra (George Szell conducting) Ludwig von Beethoven Symphony No. 9 "Chorale (Ode To Joy)" Opus 125 IV.] (https://www.youtube.com/watch?v=4g5770gaais) |

0 commit comments

Comments
 (0)