File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 roles :
1313 - { role: notify, tags: [notify] }
1414 - { role: docker, tags: [docker] }
15- - { role: iptables, tags: [iptables, security] }
1615 - { role: datadog }
1716 - { role: git_repo, tags: [deploy] }
1817 - { role: dock-init, tags: [deploy] }
Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ enviroment_vars:
1010 RABBITMQ_PASSWORD : " {{ rabbit_password }}"
1111 RABBITMQ_PORT : " {{ rabbit_port }}"
1212 RABBITMQ_USERNAME : " {{ rabbit_username }}"
13- REDIS_IPADDRESS : " {{ redis_host_address }}"
14- REDIS_PORT : " {{ redis_port }}"
1513
1614# consul values
1715consul_values :
Original file line number Diff line number Diff line change 44
55- name : copy vault auth files
66 tags : vault_files
7- sudo : yes
87 lineinfile :
98 dest="/opt/runnable/dock-init/consul-resources/vault/{{ node_env }}/{{ item.file_name }}"
109 line="{{ item.value }}"
Original file line number Diff line number Diff line change 11---
22- name : remove node_modules
3+ tags : deploy
34 when : remove_node_modules is defined
45 file :
56 path=/opt/runnable/{{ app_name }}/node_modules
67 state=absent
78
89- name : npm install {{ app_name }}
10+ tags : deploy
911 npm :
1012 path=/opt/runnable/{{ app_name }}
1113 state=latest
1214 production=yes
1315
14- - name : add env to configs
15- tags : ' update_configs'
16+ - name : create new config file
1617 sudo : yes
17- when : enviroment_vars is defined
18- with_dict : " {{ enviroment_vars }}"
19- lineinfile :
18+ template :
19+ src=upstart.conf
2020 dest=/etc/init/{{ app_name }}.conf
21- regexp="env {{ item.key }}"
22- insertafter="env NPM_BIN"
23- line="env {{ item.key }}={{ item.value }}"
24- state=present
21+ backup=yes
22+
23+ - name : make override file
24+ tags : deploy
25+ sudo : yes
26+ lineinfile :
27+ dest="/etc/init/{{ app_name }}.override"
28+ line="manual"
29+ create=yes
2530
2631- name : restart service {{ app_name }}
32+ tags : deploy
2733 sudo : yes
34+ when : dock is not defined
2835 service :
2936 name={{ app_name }}
3037 state=restarted
Original file line number Diff line number Diff line change 1+ #!upstart
2+ description "{{ app_name }}"
3+ author "Anandkumar Patel"
4+
5+ env NPM_BIN=/usr/local/bin/npm
6+ env APP_DIR=/opt/runnable/{{ app_name }}
7+ env LOG_FILE=/var/log/{{ app_name }}.log
8+ env NODE_ENV={{ node_env }}
9+
10+ {% if enviroment_vars is defined %}
11+ {% for name, value in enviroment_vars.iteritems() %}
12+ env {{ name }}={{ value }}
13+ {% endfor %}
14+ {% endif %}
15+
16+ start on (local-filesystems and net-device-up IFACE=eth0)
17+ stop on shutdown
18+
19+ script
20+ touch $LOG_FILE
21+ chdir $APP_DIR
22+ echo $$ > /var/run/{{ app_name }}.pid
23+ exec $NPM_BIN start >> $LOG_FILE 2>&1
24+ end script
25+
26+ pre-start script
27+ # Date format same as (new Date()).toISOString() for consistency
28+ echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> $LOG_FILE
29+ end script
30+
31+ pre-stop script
32+ rm /var/run/{{ app_name }}.pid
33+ echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> $LOG_FILE
34+ end script
35+
36+ post-start script
37+ echo "===== App restarted =====" >> $LOG_FILE
38+ end script
39+
40+ respawn
41+ respawn limit 5 1 # give up restart after 5 respawns in 1 seconds
Original file line number Diff line number Diff line change 11[stage:vars]
2+ api_hostname=api-staging-codenow.runnableapp.com
23aws_access_key_id=AKIAJ3RCYU6FCULAJP2Q
34aws_secret_access_key=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
45consul_host_address=consul-server-staging-codenow.runnableapp.com
6+ detention_hostname=detention-staging-codenow.runnableapp.com
57domain=runnable-angular-staging-codenow.runnableapp.com
8+ eru_hostname=admin-staging-codenow.runnableapp.com
9+ fluffy_hostname=fluffy-staging-codenow.runnableapp.com
10+ mavis_hostname=mavis-staging-codenow.runnableapp.com
611node_env=stageing
12+ optimus_hostname=optimus-staging-codenow.runnableapp.com
713rabbit_password=h7n972sPLs5tWGCWe6QPSCnaxDWjvnpEFEA9c9mBqauH3f22
814rabbit_username=5WE5wsEQmfw9sLsppJ4CEq9Auea8mPC4kgVt3xYqKxbYHPfP
915registry_host=10.8.4.126
16+ user_content_domain=runnable3.net
1017vault_auth_token=ff3b5003-5949-5d7d-7c0d-4fa21efe6666
1118vault_token_01=c9dd02cd0f28aaeb8b819d50d2b7b274dab5ddc7fc64871a979bcb4472c9355501
1219vault_token_02=15cc2b24a82fd3876476dd28b48756f56b4a78d2a23d18f0faca390aaf17092e02
You can’t perform that action at this time.
0 commit comments