-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTaskfileGCloud.yml
59 lines (51 loc) · 1.24 KB
/
TaskfileGCloud.yml
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
version: '3'
tasks:
cluster:config:
- >
nuv config gke
--name=$GKE_PROJECT
--project="$GKE_PROJECT"
--region="us-east1"
--count="3"
--vm="e2-standard-2"
--disk="50"
cluster:create:
- task: cluster:config
- nuv cloud gke create
cluster:delete:
- task: cluster:config
- nuv cloud gke delete
vm:config:
cmds:
- >
nuv config gcloud
--project=$GKE_PROJECT
--region="{{.REGION}}"
--vm="{{.VM_TYPE}}"
--disk="200"
--image="{{.IMAGE}}"
--key=$HOME/.ssh/id_rsa.pub
requires:
vars: [VM_TYPE,REGION,IMAGE]
vm:create:
cmds:
- task: vm:config
vars:
VM_TYPE: "{{.VM_TYPE}}"
REGION: "{{.REGION}}"
IMAGE: "{{.IMAGE}}"
- nuv cloud gcloud vm-create {{.NAME}}
- nuv cloud gcloud vm-getip {{.NAME}} >_ip
- nuv cloud {{.TYPE}} create SERVER=$(cat _ip) USERNAME=ubuntu
requires:
vars: [NAME, TYPE, VM_TYPE, REGION, IMAGE]
vm:delete:
cmds:
- task: vm:config
vars:
VM_TYPE: "{{.VM_TYPE}}"
REGION: "{{.REGION}}"
IMAGE: "{{.IMAGE}}"
- nuv cloud gcloud vm-delete {{.NAME}}
requires:
vars: [NAME,VM_TYPE,REGION, IMAGE]