Skip to content

Commit df1dfa1

Browse files
added yaml file checks (#891)
* added yaml file checks * replaced source repo * replaced source repo * yamlfmt * using google yamlfmt * using google yamlfmt * fixed * Update code * Add yamllint * Clean up --------- Co-authored-by: Arkadii Yakovets <[email protected]>
1 parent 9768ac1 commit df1dfa1

18 files changed

+375
-350
lines changed

.github/ansible/production/nest.yaml

+106-106
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,106 @@
1-
- name: Deploy Nest to Production
2-
hosts: production_nest
3-
tasks:
4-
- name: Copy docker-compose.yaml
5-
ansible.builtin.copy:
6-
src: '{{ github_workspace }}/docker-compose-production.yaml'
7-
dest: ~/docker-compose.yaml
8-
mode: '0644'
9-
10-
- name: Ensure backend directory exists
11-
ansible.builtin.file:
12-
path: ~/backend
13-
state: directory
14-
mode: '0755'
15-
16-
- name: Copy backend makefile
17-
ansible.builtin.copy:
18-
src: '{{ github_workspace }}/backend/Makefile'
19-
dest: ~/backend/Makefile
20-
mode: '0644'
21-
22-
- name: Update backend makefile for the production environment
23-
shell:
24-
cmd: "sed -i 's/\\bnest-backend\\b/production-nest-backend/' ~/backend/Makefile"
25-
26-
- name: Ensure cspell directory exists
27-
ansible.builtin.file:
28-
path: ~/cspell
29-
state: directory
30-
mode: '0755'
31-
32-
- name: Copy cspell makefile
33-
ansible.builtin.copy:
34-
src: '{{ github_workspace }}/cspell/Makefile'
35-
dest: ~/cspell/Makefile
36-
mode: '0644'
37-
38-
- name: Ensure frontend directory exists
39-
ansible.builtin.file:
40-
path: ~/frontend
41-
state: directory
42-
mode: '0755'
43-
44-
- name: Copy frontend makefile
45-
ansible.builtin.copy:
46-
src: '{{ github_workspace }}/frontend/Makefile'
47-
dest: ~/frontend/Makefile
48-
mode: '0644'
49-
50-
- name: Update frontend makefile for the production environment
51-
shell:
52-
cmd: "sed -i 's/\\bnest-frontend\\b/production-nest-frontend/' ~/frontend/Makefile"
53-
54-
- name: Copy main makefile
55-
ansible.builtin.copy:
56-
src: '{{ github_workspace }}/Makefile'
57-
dest: ~/Makefile
58-
mode: '0644'
59-
60-
- name: Ensure schema directory exists
61-
ansible.builtin.file:
62-
path: ~/schema
63-
state: directory
64-
mode: '0755'
65-
66-
- name: Copy schema makefile
67-
ansible.builtin.copy:
68-
src: '{{ github_workspace }}/schema/Makefile'
69-
dest: ~/schema/Makefile
70-
mode: '0644'
71-
72-
- name: Copy directory recursively
73-
copy:
74-
src: '{{ github_workspace }}/backend/data'
75-
dest: ~/
76-
mode: '0755'
77-
78-
- name: Copy .env.backend
79-
copy:
80-
src: '{{ github_workspace }}/.env.backend'
81-
dest: ~/
82-
mode: '0400'
83-
84-
- name: Copy .env.db
85-
copy:
86-
src: '{{ github_workspace }}/.env.db'
87-
dest: ~/
88-
mode: '0400'
89-
90-
- name: Prune docker images
91-
shell:
92-
cmd: docker image prune -f
93-
94-
- name: Update Docker images
95-
shell:
96-
cmd: docker compose pull
97-
98-
- name: Retart services
99-
shell:
100-
cmd: docker compose up -d
101-
102-
- name: Index data
103-
async: 1800 # 30 minutes
104-
poll: 0
105-
shell: |
106-
make index-data > /var/log/nest/production/index-data.log 2>&1
1+
- name: Deploy Nest to Production
2+
hosts: production_nest
3+
tasks:
4+
- name: Copy docker-compose.yaml
5+
ansible.builtin.copy:
6+
src: '{{ github_workspace }}/docker-compose-production.yaml'
7+
dest: ~/docker-compose.yaml
8+
mode: '0644'
9+
10+
- name: Ensure backend directory exists
11+
ansible.builtin.file:
12+
path: ~/backend
13+
state: directory
14+
mode: '0755'
15+
16+
- name: Copy backend makefile
17+
ansible.builtin.copy:
18+
src: '{{ github_workspace }}/backend/Makefile'
19+
dest: ~/backend/Makefile
20+
mode: '0644'
21+
22+
- name: Update backend makefile for the production environment
23+
shell:
24+
cmd: "sed -i 's/\bnest-backend\b/production-nest-backend/' ~/backend/Makefile"
25+
26+
- name: Ensure cspell directory exists
27+
ansible.builtin.file:
28+
path: ~/cspell
29+
state: directory
30+
mode: '0755'
31+
32+
- name: Copy cspell makefile
33+
ansible.builtin.copy:
34+
src: '{{ github_workspace }}/cspell/Makefile'
35+
dest: ~/cspell/Makefile
36+
mode: '0644'
37+
38+
- name: Ensure frontend directory exists
39+
ansible.builtin.file:
40+
path: ~/frontend
41+
state: directory
42+
mode: '0755'
43+
44+
- name: Copy frontend makefile
45+
ansible.builtin.copy:
46+
src: '{{ github_workspace }}/frontend/Makefile'
47+
dest: ~/frontend/Makefile
48+
mode: '0644'
49+
50+
- name: Update frontend makefile for the production environment
51+
shell:
52+
cmd: sed -i 's/\bnest-frontend\b/production-nest-frontend/' ~/frontend/Makefile
53+
54+
- name: Copy main makefile
55+
ansible.builtin.copy:
56+
src: '{{ github_workspace }}/Makefile'
57+
dest: ~/Makefile
58+
mode: '0644'
59+
60+
- name: Ensure schema directory exists
61+
ansible.builtin.file:
62+
path: ~/schema
63+
state: directory
64+
mode: '0755'
65+
66+
- name: Copy schema makefile
67+
ansible.builtin.copy:
68+
src: '{{ github_workspace }}/schema/Makefile'
69+
dest: ~/schema/Makefile
70+
mode: '0644'
71+
72+
- name: Copy directory recursively
73+
copy:
74+
src: '{{ github_workspace }}/backend/data'
75+
dest: ~/
76+
mode: '0755'
77+
78+
- name: Copy .env.backend
79+
copy:
80+
src: '{{ github_workspace }}/.env.backend'
81+
dest: ~/
82+
mode: '0400'
83+
84+
- name: Copy .env.db
85+
copy:
86+
src: '{{ github_workspace }}/.env.db'
87+
dest: ~/
88+
mode: '0400'
89+
90+
- name: Prune docker images
91+
shell:
92+
cmd: docker image prune -f
93+
94+
- name: Update Docker images
95+
shell:
96+
cmd: docker compose pull
97+
98+
- name: Retart services
99+
shell:
100+
cmd: docker compose up -d
101+
102+
- name: Index data
103+
async: 1800 # 30 minutes
104+
poll: 0
105+
shell: |
106+
make index-data > /var/log/nest/production/index-data.log 2>&1

.github/ansible/production/proxy.yaml

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
- name: Deploy Production Nest Proxy
2-
hosts: production_nest_proxy
3-
tasks:
4-
- name: Copy proxy docker-compose.yaml
5-
ansible.builtin.copy:
6-
src: '{{ github_workspace }}/proxy/docker-compose.yaml'
7-
dest: ~/docker-compose.yaml
8-
mode: '0644'
1+
- name: Deploy Production Nest Proxy
2+
hosts: production_nest_proxy
3+
tasks:
4+
- name: Copy proxy docker-compose.yaml
5+
ansible.builtin.copy:
6+
src: '{{ github_workspace }}/proxy/docker-compose.yaml'
7+
dest: ~/docker-compose.yaml
8+
mode: '0644'
99

10-
- name: Copy proxy configuration file
11-
ansible.builtin.copy:
12-
src: '{{ github_workspace }}/proxy/production.conf'
13-
dest: ~/production.conf
14-
mode: '0644'
10+
- name: Copy proxy configuration file
11+
ansible.builtin.copy:
12+
src: '{{ github_workspace }}/proxy/production.conf'
13+
dest: ~/production.conf
14+
mode: '0644'
1515

16-
- name: Update Docker images
17-
shell:
18-
cmd: docker compose pull
16+
- name: Update Docker images
17+
shell:
18+
cmd: docker compose pull
1919

20-
- name: Retart proxy server
21-
shell:
22-
cmd: docker compose restart
20+
- name: Retart proxy server
21+
shell:
22+
cmd: docker compose restart
+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
- name: Run Nest Production Data Sync
2-
hosts: production_nest
3-
tasks:
4-
- name: Sync Nest data
5-
async: 21600 # 6 hours
6-
poll: 0
7-
shell: |
8-
make sync-data > /var/log/nest/production/sync-data.log 2>&1
1+
- name: Run Nest Production Data Sync
2+
hosts: production_nest
3+
tasks:
4+
- name: Sync Nest data
5+
async: 21600 # 6 hours
6+
poll: 0
7+
shell: |
8+
make sync-data > /var/log/nest/production/sync-data.log 2>&1

0 commit comments

Comments
 (0)