Skip to content

Commit 05de2b5

Browse files
author
Henry Mollman
committed
Merge remote-tracking branch 'origin/master' into update-network-canary-instance
2 parents c16f369 + b023ab0 commit 05de2b5

48 files changed

Lines changed: 660 additions & 399 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ npm-debug.log
99
ca.srl
1010
.DS_Store
1111
ansible/roles/hipache/templates/runnable*
12-
ansible/certs/*
13-
ansible/k8/**/configMaps/*cert*
12+
enviroments/**/k8/**/configMaps/*cert*
13+
environments/*/secrets/**/*
14+
# Leaving for now while PR is merged
15+
environments/*/k8
16+
# Meant to not break anything. Might remove later
17+
environments/self-hosted-test
1418
*.retry
1519
*.tfstate*
1620
terraform/credentials.tfvars
1721
terraform/.build
1822
ansible/secrets/*
23+
ansible/single-host-part-*.yml
1924
.idea

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Scripts for managing our deployments.
99
Before you can deploy you'll need to install the appropriate tools, scripts, and keys on your local machine.
1010
To do so, execute the following steps:
1111

12-
1. Install Ansible v2.2.0.0 (the deploy automation tool we use to deploy projects to production)
12+
1. Install Ansible v2.2.1.0 (the deploy automation tool we use to deploy projects to production)
1313
Installation: http://docs.ansible.com/intro_installation.html
1414
Upgrading: `sudo pip install ansible==2.2.1.0` or http://docs.ansible.com/ansible/intro_installation.html#latest-releases-via-pip
1515

@@ -19,9 +19,9 @@ https://github.com/CodeNow/devops-scripts
1919
3. Change to the devops scripts repo directory and run the following command:
2020
`ln -s /<local-path-to-devops-scripts>/ssh/config ~/.ssh/config`
2121

22-
4. Obtain the "Ansible Secrets" zip from one password
22+
4. Obtain the "Ansible Secrets" zip for the environment you want to deploy (or create the new environment following [./environments/README.md](./environments/README.md))
2323

24-
5. Unzip file obtained above into `devops-scripts/ansible/secrets`
24+
5. Unzip file obtained above into `devops-scripts/environments/${YOUR_ENV}/secrets`
2525

2626
6. Copy the `*.pem` files from `devops-scripts/ansible/secrets` to your `~/.ssh` directory
2727

@@ -71,14 +71,15 @@ of the docker image needed to run the service on our architecture.
7171

7272
##### Command
7373
```
74-
ansible-playbook -i ./[inventory_dir] [service-playbook] -e git_branch=[branch-or-tag] -t deploy
74+
ansible-playbook -i ./[inventory_dir] [service-playbook] -e @[main-var-file] -e git_branch=[branch-or-tag] -t deploy
7575
```
7676

7777
##### Arguments
7878
- `[inventory_dir]` - The environment inventory files (servers and variables). Should be one of the following:
79-
- `stage-hosts` - Runnable sandbox staging environment services
80-
- `gamma-hosts` - Gamma services (internal use only; production mirror)
81-
- `delta-hosts` - Delta services (real production)
79+
- `/enviroments/stage` - Runnable sandbox staging environment services
80+
- `/environments/gamma` - Gamma services (internal use only; production mirror)
81+
- `/environments/delta` - Delta services (real production)
82+
- `[main-var-file]` - The file with the main variables for the environment
8283
- `[service-playbook]` - The playbook for the service you wish to deploy, ex:
8384
- `api.yml` - Deploys both the api and the api-workers services
8485
- `shiva.yml` - Deploys the shiva micro-service
@@ -98,15 +99,15 @@ being tested in the production mirror.
9899

99100
##### Command
100101
```
101-
ansible-playbook -i ./[inventory_dir] [service-playbook] -e git_branch=[branch-or-tag] -e build_args=--no-cache
102+
ansible-playbook -i ./[inventory_dir] [service-playbook] -e @[main-var-file] -e git_branch=[branch-or-tag] -t deploy -e build_args=--no-cache
102103
```
103104

104105
##### Arguments
105106
- `[inventory_dir]` - The environment inventory files (servers and variables).
107+
- `[main-var-file]` - The file with the main variables for the environment
106108
- `[service-playbook]` - The playbook for the service you wish to deploy.
107109
- `[branch-or-tag]` - The branch or tag you wish to deploy.
108110

109-
110111
## Reverting
111112
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.
112113
Simply run the appropriate deploy command in the previous section with the last release tag and the new deploy will be reverted.
@@ -125,23 +126,24 @@ It is the custom at Runnable to play a song to the entire team when deploying. F
125126
| charon | [Enter Sandman - Metallica](https://www.youtube.com/watch?v=CD-E-LDc384) |
126127
| clio | [Billy Joel - We Didn't Start the Fire](https://www.youtube.com/watch?v=eFTLKWw542g) |
127128
| cream | [C.R.E.A.M. - Wu-Tang Clan](https://www.youtube.com/watch?v=PBwAxmrE194) |
128-
| deployer | [Roll our](https://www.youtube.com/watch?v=t21DFnu00Dc) |
129+
| customerbot | [Trailer Park Boys Theme](https://www.youtube.com/watch?v=dI6Drn3OA70) |
130+
| deployer | [Rollout - Ludacris](https://www.youtube.com/watch?v=t21DFnu00Dc) |
129131
| detention | [Unbreakable Kimmy Schmidt](https://youtu.be/CV9xF8CjhJk?t=21s) |
130132
| docker-listener | [Call Me Maybe - Carly Rae Jepsen](https://www.youtube.com/watch?v=fWNaR-rxAic) |
131133
| drake | [Drake - Hotline Bling](https://www.youtube.com/watch?v=uxpDa-c-4Mc)
132134
| filibuster | [He's a Pirate - Pirates Of The Caribbean](https://www.youtube.com/watch?v=yRh-dzrI4Z4) |
133-
| 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) |
135+
| 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) |
134136
| github-proxy | [Proxy - Martin Garrix](https://www.youtube.com/watch?v=NWB6-PJw4Mk) |
135137
| khronos | [Time After Time - Cyndi Lauper](https://www.youtube.com/watch?v=VdQY7BusJNU) |
136138
| krain | [Men at Work - Down Under](https://www.youtube.com/watch?v=XfR9iY5y94s) |
137139
| link | [Zelda Main Theme Song](https://www.youtube.com/watch?v=cGufy1PAeTU) |
138-
| mavis | [Fairy Tail theme song](https://www.youtube.com/watch?v=R4UFCTMrV-o) |
140+
| mavis | [Fairy Tail Theme song](https://www.youtube.com/watch?v=R4UFCTMrV-o) |
139141
| navi | [Ocarina of Time: Lost Woods The Legend of Zelda](https://www.youtube.com/watch?v=iOGpdGEEcJM) |
140142
| optimus | [Original Transformers Opening Theme](https://www.youtube.com/watch?v=nLS2N9mHWaw) |
141143
| pheidi | [Chariots of Fire Theme](https://www.youtube.com/watch?v=CSav51fVlKU) |
142-
| runnable-angular | [Push it to the limit - Scarface](https://www.youtube.com/watch?v=9D-QD_HIfjA) |
143-
| sauron | [Sauron theme song from LOTR](https://www.youtube.com/watch?v=V_rk9VBrXMY) |
144-
| Security Groups | [Out of the Woods - Tayor Swift](https://www.youtube.com/watch?v=JLf9q36UsBk)
144+
| runnable-angular | [Push It To The Limit - Scarface](https://www.youtube.com/watch?v=9D-QD_HIfjA) |
145+
| sauron | [Sauron Theme Song from LOTR](https://www.youtube.com/watch?v=V_rk9VBrXMY) |
146+
| Security Groups | [Out Of The Woods - Tayor Swift](https://www.youtube.com/watch?v=JLf9q36UsBk)
145147
| shiva | [FFXIV Shiva Theme](https://www.youtube.com/watch?v=noJiH8HLZw4) |
146148
| starlord | [Blue Swede - Hooked on a Feeling](https://www.youtube.com/watch?v=NrI-UBIB8Jk) |
147149
| swarm-deamon | [Pink Floyd - Another Brick In The Wall](https://www.youtube.com/watch?v=5IpYOF4Hi6Q) |

ansible/customerbot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
- hosts: customerbot
3+
vars_files:
4+
- group_vars/alpha-customerbot.yml
5+
roles:
6+
- role: notify
7+
8+
- role: builder
9+
10+
- role: k8-deployment

ansible/dock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
name={{ dock }}
1010
groups=dock
1111

12-
- include: image-builder.yml git_branch="v4.5.0"
12+
- include: image-builder.yml git_branch="v4.6.0"
1313

1414
- hosts: "{{ dock }}"
1515
tasks:

ansible/gamma-hosts/variables

Lines changed: 0 additions & 192 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
- hosts: localhost
3+
connection: local
4+
tasks:
5+
- name: generate client certs
6+
shell:
7+
cmd: "./roles/docker_client/scripts/genClientCert.sh {{ item }} {{ certs_root }}"
8+
chdir: ./
9+
with_items:
10+
- "api"
11+
- "api-core"
12+
- "socket-server"
13+
- "api-socket-server"
14+
- "workers"
15+
- "api-worker"
16+
- "khronos"
17+
- "palantiri"
18+
- "docker-listener"
19+
- "shiva"
20+
- "sauron"
21+
- "swarm-manager"

ansible/group_vars/all.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
---
2+
# Defaults
3+
github_domain: api.github.com
4+
github_protocol: https
5+
26
# ops
37
ops_slack_channel_url: https://hooks.slack.com/services/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
4-
pager_duty_key: testkey
5-
opts_root: "./k8/{{ env }}/{{ name }}"
8+
environment_root: "../environments/{{ env }}/"
9+
opts_root: "{{ environment_root }}/k8/{{ name }}"
10+
secrets_root: "{{ environment_root }}/secrets/"
11+
certs_root: "{{ secrets_root }}/certs/"
12+
domains_root: "{{ secrets_root }}/domains/"
13+
docker_client_root: "{{ secrets_root }}/docker-client/"
614
config_maps_path: "{{ opts_root }}/configMaps"
715
services_path: "{{ opts_root }}/services"
816
deployments_path: "{{ opts_root }}/deployments"
@@ -32,8 +40,6 @@ dockerfile: basic_node/Dockerfile
3240
docker_network: 172.17.0.0/16
3341
base_dockerfile: node_base
3442

35-
docker_config: runnable
36-
3743
# slack rooms to send notifications
3844
slack_token: T029DEC10/B1RSX8LNS/qLLSYEEqkGddohOdE44eDf3j
3945
slack_channels: [ '#ops' ]
@@ -56,6 +62,7 @@ core_file_dir: /docker/app-cores
5662
# agreeable-egret
5763
agreeable_egret_hostname: egret.{{ domain }}
5864
egret_pg_database: egret
65+
egret_port: 65520
5966

6067
#angular
6168
angular_url: https://app.{{ domain }}
@@ -91,6 +98,7 @@ charon_port: 53
9198
# clio
9299
clio_host_address: clio
93100
clio_port: 8008
101+
clio_mongo_database: clio
94102

95103
# consul
96104
consul_api_port: 8500
@@ -221,7 +229,7 @@ swarm_container_name: swarm
221229
link_hello_runnable_token: 5d8f7029d3d6941b0fc62a7eb8c605d8e0bc7c29
222230
navi_mongo_database: navi
223231

224-
npm_token: c76363e9-78e0-4667-82ac-e2ac01efcfe2
232+
npm_token: c0c4b32a-3de5-4e27-9d32-56c1616746d8
225233

226234
# remote vault
227235
vault_port: 8200

0 commit comments

Comments
 (0)