-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshippable.yml
71 lines (64 loc) · 2.53 KB
/
shippable.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
59
60
61
62
63
64
65
66
67
68
69
70
71
resources:
# resources for the provision-gke-kubernetes-cluster provgke
- name: provgke_cluster_params
type: params
version:
params:
PROVGKE_CLUSTER_NAME: "test-kube-cluster"
PROVGKE_CLUSTER_NUM_NODES: 1
PROVGKE_CLUSTER_MACHINE_TYPE: "n1-standard-1"
PROVGKE_KUBERNETES_NAMESPACE: "kube-app"
# GitHub repo holding scripts to be used in runsh pipeline job
- name: provgke_gitRepo
type: gitRepo
integration: drship_github # replace with your GitHub integration name
pointer:
# replace with source code location (e.g. GitHub) where you cloned this
# sample project.
sourceName: devops-recipes/provision-gke-kubernetes-cluster
branch: master
# config for GKE CLI
- name: provgke_cliConfig
type: cliConfig
integration: drship_gcloud # replace with your Google Cloud integration name
pointer:
region: us-central1-b
# trigger for the provision-gke-kubernetes-cluster app
- name: provgke_trigger
type: trigger
version:
# update counter to trigger the workflow
counter: 2
jobs:
# jobs for the provision-gke-kubernetes-cluster app
# Job that provisions the GKE cluster
- name: provision_gke_cluster_job
type: runSh
steps:
- IN: provgke_cluster_params
- IN: provgke_gitRepo
# manually trigger the cluster provisioning job and not on every commit to the repository
switch: off
- IN: provgke_cliConfig
scopes:
- gke
- IN: provgke_trigger
- TASK:
# invoke a script that provisions the GKE cluster defined in the provgke_cluster_params params resource
- script: . $PROVGKE_GITREPO_PATH/gitRepo/provision_gke_cluster.sh $PROVGKE_CLUSTER_NAME $PROVGKE_CLUSTER_NUM_NODES $PROVGKE_CLUSTER_MACHINE_TYPE
# Job that deprovisions the GKE cluster
- name: deprovision_gke_cluster_job
type: runSh
steps:
- IN: provgke_cluster_params
- IN: provgke_gitRepo
switch: off
- IN: provgke_cliConfig
scopes:
- gke
- IN: provision_gke_cluster_job
- TASK:
# invoke a script that deprovisions the GKE cluster defined in the provgke_cluster_params params resource
# $GKE_CLICONFIG_POINTER_REGION is an environment variable that is automatically created and injected
# by the gke_cliConfig resource and points to the availability zone.
- script: . $PROVGKE_GITREPO_PATH/gitRepo/deprovision_gke_cluster.sh $PROVGKE_CLUSTER_NAME $PROVGKE_CLICONFIG_POINTER_REGION $PROVGKE_KUBERNETES_NAMESPACE