forked from fastapi/full-stack-fastapi-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnuki.yaml
More file actions
302 lines (274 loc) · 8.17 KB
/
nuki.yaml
File metadata and controls
302 lines (274 loc) · 8.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
---
project_name:
type: input
message: Choose a base name for this project
default: Base Project
project_slug:
type: input
message: Choose a project slug
default: "{{ nuki.project_name|lower|replace(' ', '-') }}"
domain_main:
type: input
message: Enter a domain name if different from the project slug
default: "{{nuki.project_slug}}"
domain_staging:
type: input
message: Enter a domain for staging
default: stag.{{nuki.domain_main}}
ssh_key_name:
type: input
message: Enter a name for a new sshkey to log in to your instance
default: mykey
# docker swarm
docker_swarm_setup:
type: confirm
message: Do you want to customize docker swarm
docker_swarm_stack_name_main:
when: "{{ nuki.docker_swarm_setup }}"
type: input
message: Enter a name for the docker swarm
default: "{{nuki.domain_main|replace('.', '-')}}"
docker_swarm_stack_name_staging:
when: "{{ nuki.docker_swarm_setup }}"
type: input
message: Enter a name for the docker swarm staging
default: "{{ nuki.domain_staging | replace('.', '-') }}"
secret_key:
type: input
message: Enter a value for the secret key for this project
default: changethis
first_superuser:
type: input
message: Enter the name of the super user for the site
default: "admin@{{nuki.domain_main}}"
first_superuser_password:
type: input
message: Enter a password for this super user
default: changethis
backend_cors_origins:
type: stat
input: '["http://localhost", "http://localhost:4200", "http://localhost:3000",
"http://localhost:8080", "https://localhost", "https://localhost:4200", "https://localhost:3000",
"https://localhost:8080", "http://dev.{{nuki.domain_main}}", "https://{{nuki.domain_staging}}",
"https://{{nuki.domain_main}}", "http://local.dockertoolbox.tiangolo.com",
"http://localhost.tiangolo.com"]'
# email settings
setup_email:
type: confirm
message: Do you want to set up email w/ an smtp server?
smtp_port:
when: "{{ nuki.setup_email }}"
type: input
message: Enter a port for stmp
default: '587'
smtp_host:
when: "{{ nuki.setup_email }}"
type: input
message: Enter a host for stmp
default: ''
smtp_user:
when: "{{ nuki.setup_email }}"
type: input
message: Enter a user for stmp
default: ''
smtp_password:
when: "{{ nuki.setup_email }}"
type: input
message: What to set
default: ''
smtp_emails_from_email:
when: "{{ nuki.setup_email }}"
type: input
message: Enter a default email to deliver from
default: "info@{{nuki.domain_main}}"
# postgres setup
postgres_password:
type: input
message: Enter a password for postgres
default: changethis
pgadmin_default_user:
type: input
message: Enter a user for pgadmin
default: "{{nuki.first_superuser}}"
pgadmin_default_user_password:
type: input
message: Enter a password for pgadmin
default: "{{nuki.first_superuser_password}}"
# traffic setup
traefik_constraint_tag:
type: input
message: Enter a traefik constraint tag
default: "{{nuki.domain_main}}"
traefik_constraint_tag_staging:
type: input
message: Enter a domain for traefik staging
default: "{{nuki.domain_staging}}"
traefik_public_constraint_tag:
type: input
message: Enter a public tag for traefik
default: traefik-public
flower_auth:
type: input
message: Enter a flower admin and password in the form 'user:password'
default: "admin:{{nuki.first_superuser_password}}"
sentry_dsn:
type: input
message: Enter dsn for sentry, example is default, you can set up a free account
default: https://1234abcd:[email protected]/30
#########################################################
# docker prefixes, first option is a select to ignore.
docker_prefixes:
type: confirm
message: Do you want to attach any prefixes to your docker images?
docker_image_prefix:
when: "{{ nuki.docker_prefixes > 0}}"
type: input
message: Enter prefix for docker image
docker_image_backend:
when: "{{ nuki.docker_prefixes > 0 }}"
type: input
message: Enter prefix for docker image backend
default: "{{nuki.docker_image_prefix}}backend"
docker_image_celeryworker:
when: "{{ nuki.docker_prefixes > 0 }}"
type: input
message: Enter prefix for celery worker
default: "{{nuki.docker_image_prefix}}celeryworker"
docker_image_frontend:
when: "{{ nuki.docker_prefixes > 0 }}"
type: input
message: Enter Prefix for docker image frontend
default: "{{nuki.docker_image_prefix}}frontend"
###########################################################
_copy_without_render:
- frontend/src/**/*.html
- frontend/src/**/*.vue
- frontend/node_modules/*
- backend/app/app/email-templates/**
aws_region:
type: input
message: What AWS region?
default: us-west-2
############################################################3
# optional set up eks
setup_eks:
type: confirm
message: Do you want to set up an EKS cluster?
eks_cluster_name:
when: "{{ nuki.setup_eks }}"
type: input
message: What do you want to name your eks cluster?
default: mycluster
eks_num_workers:
when: "{{ nuki.setup_eks }}"
type: input
message: Number of workers on cluster?
default: '1'
eks_cluster_autoscale:
when: "{{ nuki.setup_eks }}"
type: input
message: Autoscale workers? Enter either true or false
default: 'false'
eks_cluster_autoscale_min_workers:
when: "{{ nuki.setup_eks }}"
type: input
message: Enter minimum number of workers
default: '1'
eks_cluster_autoscale_max_workers:
when: "{{ nuki.setup_eks }}"
type: input
message: Enter maximum number of workers
default: '1'
############################################# end eks setup
# aws network setup
aws_network_setup:
type: confirm
message: Do you want to set up or connect to existing AWS infrastructure?
default: false
print_network_setup_bool:
type: pprint
statement:
vpc_name:
when: "{{ nuki.aws_network_setup }}"
type: input
message: Enter name of VPC otherwise leave blank for none
default: ""
azs:
when: "{{ nuki.aws_network_setup }}"
type: input
message: Number of azs
default: '1'
num_azs:
when: "{{ nuki.aws_network_setup }}"
type: input
message: Again number of azs, this needs to be worded better
default: '1'
iam_instance_profile:
when: "{{ nuki.aws_network_setup }}"
type: input
message: iam_instance_profile to use
network_name:
when: "{{ nuki.aws_network_setup }}"
type: input
message: Network name
create_sg:
when: "{{ nuki.aws_network_setup }}"
type: input
message: Create a security group?
default: 'false'
create:
when: "{{ nuki.aws_network_setup }}"
type: input
message: Create a deployment
default: 'true'
create_ebs_volume:
when: "{{ nuki.aws_network_setup }}"
type: input
message: Create an EBS volume for this deployment (enter true or false)
default: 'false'
render:
type: nukikata
context_file: nukikata.yaml
context_key: cookiecutter
existing_context: "{{ nuki }}"
no_input: true
post_render_action_:
type: checkbox
message: What do you want to do next?
choices:
- deploy: Deploy the instance?
# this is dope, note all paths are absolute in nuki so as long as we have
# access to calling directory we can go anywhere and do anything
# process for demo should be cd to project dir, clone this repo, it sets itself up
# later set up deployment using command functions as below.
#deploy_example_:
# type: command
# chdir: "{{ calling_directory }}"
# #command: "cd {{ nuki.project_slug }} && echo '{{ calling_directory }}' >> this.txt"
#
#
#
#deploy_eks_:
# type: command
# chdir: "{{ calling_directory }}"
# #command: "cd {{ nuki.project_slug }} && echo 'executing deploy_eks_command' >> eks.txt"
#
#
#deploy_single_:
# type: command
# chdir: "{{ calling_directory }}"
# #command: "cd {{ nuki.project_slug }} && echo 'executing deploy_single_command' >> single.txt"
#
#deploy_local_:
# type: command
# chdir: "{{ calling_directory }}"
# #command: "cd {{ nuki.project_slug }} && echo 'executing deploy_local_command' >> local.txt"
prompt_user_to_enter_ssh_keys:
type: confirm
message: Confirm if you're ready to create new ssh keys
generate_ssh_keys_:
when: "{{ nuki.prompt_user_to_enter_ssh_keys and nuki.ssh_key_name }}"
type: command
message: creating ssh keys
chdir: "{{ calling_directory}}"
command: "cd {{ nuki.project_slug }} && ssh-keygen -t rsa -f {{ nuki.ssh_key_name }} -q -N ''"