-
Notifications
You must be signed in to change notification settings - Fork 1
/
pong.gocd.yaml
122 lines (122 loc) · 3.52 KB
/
pong.gocd.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
121
122
format_version: 10
pipelines:
pong:
group: sample
label_template: ${COUNT}
lock_behavior: none
display_order: -1
materials:
#git-589ea36:
#git: https://github.com/hoyle1974/synthetic_infra.git
#shallow_clone: false
#auto_update: true
#branch: main
upstream:
pipeline: pingpong
stage: compile
stages:
- package:
fetch_materials: true
keep_artifacts: true
clean_workspace: false
approval:
type: success
allow_only_on_success: false
jobs:
package-pong:
elastic_profile_id: buildah
timeout: 0
artifacts:
- build:
source: build
tasks:
- fetch:
pipeline: pingpong
stage: compile
job: compile-pingpong
source: pingpong/
- exec:
arguments:
- -c
- pwd
command: /bin/bash
run_if: passed
- exec:
arguments:
- -c
- find .
command: /bin/bash
run_if: passed
- exec:
arguments:
- -c
- buildah bud -t pong:${GO_PIPELINE_LABEL} -f pingpong/Dockerfile.pong .
command: /bin/bash
run_if: passed
- exec:
arguments:
- -c
- mkdir build && cd build && buildah push pong:${GO_PIPELINE_LABEL} oci-archive:./pong.tar:pong:${GO_PIPELINE_LABEL}
command: /bin/bash
run_if: passed
- push:
fetch_materials: true
keep_artifacts: false
clean_workspace: false
approval:
type: success
allow_only_on_success: false
jobs:
push-pong:
elastic_profile_id: buildah
timeout: 0
artifacts:
tasks:
- fetch:
pipeline: pong
stage: package
job: package-pong
source: build/
- exec:
arguments:
- -c
- buildah pull oci-archive:./build/pong.tar
command: /bin/bash
run_if: passed
- exec:
arguments:
- -c
- buildah login -u jstrohm -p ${DOCKER_PASSWORD} docker.io
command: /bin/bash
run_if: passed
- exec:
arguments:
- -c
- buildah push pong:${GO_PIPELINE_LABEL} docker://jstrohm/pong:${GO_PIPELINE_LABEL}
command: /bin/bash
run_if: passed
- deploy:
fetch_materials: true
keep_artifacts: false
clean_workspace: false
approval:
type: success
allow_only_on_success: false
jobs:
push-ping:
elastic_profile_id: kubectl
timeout: 0
artifacts:
tasks:
- exec:
arguments:
- -c
- kubectl get pod -n default
command: /bin/bash
run_if: passed
- exec:
arguments:
- -c
- kubectl set image deployment/pong pong=jstrohm/pong:${GO_PIPELINE_LABEL} -n default
command: /bin/bash
run_if: passed