-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline.yaml
120 lines (113 loc) · 2.98 KB
/
pipeline.yaml
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
# pipeline.yaml
#
# Copyright (c) 2019-2020 VMware, Inc.
#
# SPDX-License-Identifier: https://spdx.org/licenses/MIT.html
#
# Note: This pipline assumes a private insecure docker registry
#
resources:
- name: version
type: semver
source:
driver: git
uri: ((semver-git-repo))
branch: ((semver-git-repo-branch))
file: ((semver-file))
private_key: ((private-git-repo-key))
- name: sources
type: git
source:
uri: ((kwite-op-git-repo))
branch: ((kwite-op-git-repo-branch))
private_key: ((private-git-repo-key))
- name: image
type: docker-image
source:
repository: ((docker-registry-repo))
username: ((docker-registry-user))
password: ((docker-registry-passwd))
jobs:
- name: code-tests
plan:
- get: sources
trigger: true
- task: static-tests
file: sources/ci/tasks/static.yaml
vars:
taskimage: ((taskimage))
taskimagetag: ((taskimagetag))
- task: unit-tests
file: sources/ci/tasks/unit.yaml
vars:
taskimage: ((taskimage))
taskimagetag: ((taskimagetag))
- name: increment-version
serial_groups:
- version
plan:
- get: sources
passed: [code-tests]
trigger: true
- get: version
params:
bump: patch
- put: version
params:
bump: patch
- name: build-container
serial_groups:
- version
plan:
- get: sources
passed: [code-tests]
trigger: true
- get: version
passed: [increment-version]
- task: task-build
file: sources/ci/tasks/build.yaml
vars:
taskimage: ((taskimage))
taskimagetag: ((taskimagetag))
- task: container
file: sources/ci/tasks/container.yaml
vars:
taskimage: ((taskimage))
taskimagetag: ((taskimagetag))
- put: image
params:
build: container
tag: version/number
tag_as_latest: true
skip_download: true
- name: deploy
serial_groups:
- version
plan:
- get: sources
passed: [build-container]
trigger: true
- get: version
passed: [increment-version]
- get: image
passed: [build-container]
- task: task-deployment-files
file: sources/ci/tasks/deployment-files.yaml
params:
container: ((docker-registry-repo))
deployenv: ((deployenv))
vars:
taskimage: ((taskimage))
taskimagetag: ((taskimagetag))
- task: kubernetes-deploy
file: sources/ci/tasks/kubernetes-deploy.yaml
params:
cluster_url: ((k8s-cluster-url))
namespace: ((k8s-namespace))
container: ((docker-registry-repo))
cluster_ca: ((k8s-cluster-ca))
admin_key: ((k8s-admin-key))
admin_cert: ((k8s-admin-cert))
vars:
taskimage: ((taskimage))
taskimagetag: ((taskimagetag))