-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodefresh.yaml
206 lines (197 loc) · 6.12 KB
/
codefresh.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
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
version: '1.0'
stages:
- Build
- Push
steps:
CloneServices:
title: Clone Services Repo
type: git-clone
repo: open-integration/service-catalog
git: cf_github
revision: ${{CF_REVISION}}
BuildServices:
stage: Build
title: Build Services
image: golang:1.13.5-alpine3.10
working_directory: ${{CloneServices}}
commands:
- rm -rf dist || true
- apk update && apk add git make py-pip jq
- pip install yq
- go get -u github.com/gobuffalo/packr/packr
- git remote rm origin
- git remote add origin https://olegsu:${{GITHUB_TOKEN}}@github.com/open-integration/service-catalog.git
- sh ./.scripts/build.sh
- echo $GOOGLE_SERVICE_ACCOUNT_B64 | base64 -d - > ${{CF_VOLUME_PATH}}/service-account.json
- cf_export KEY_FILE_PATH=${{CF_VOLUME_PATH}}/service-account.json
- cf_export SERVICE_GIT_VERSION=$(cat git/VERSION)
- cf_export SERVICE_GOOGLE_SPREADSHEET_VERSION=$(cat google-spreadsheet/VERSION)
- cf_export SERVICE_GOOGLE_CALENDAR_VERSION=$(cat google-calendar/VERSION)
- cf_export SERVICE_TRELLO_VERSION=$(cat trello/VERSION)
- cf_export SERVICE_JIRA_VERSION=$(cat jira/VERSION)
- cf_export SERVICE_SLACK_VERSION=$(cat slack/VERSION)
- cf_export SERVICE_KUBERNETES_VERSION=$(cat kubernetes/VERSION)
- cf_export SERVICE_EXEC_VERSION=$(cat exec/VERSION)
- cf_export SERVICE_HTTP_VERSION=$(cat http/VERSION)
BuildImages:
stage: Build
title: Build All Docker Images
type: parallel
steps:
git: &dockerbuild
title: "Build Docker Image"
type: build
working_directory: ${{CloneServices}}
image_name: service_catalog/git
dockerfile: git/Dockerfile
registry: dockerhub
disable_push: true
build_arguments:
- NAME=git-${{SERVICE_GIT_VERSION}}-linux-amd64
- DIR=git
slack:
<<: *dockerbuild
dockerfile: slack/Dockerfile
image_name: service_catalog/slack
build_arguments:
- NAME=slack-${{SERVICE_SLACK_VERSION}}-linux-amd64
- DIR=slack
http:
<<: *dockerbuild
dockerfile: http/Dockerfile
image_name: service_catalog/http
build_arguments:
- NAME=http-${{SERVICE_HTTP_VERSION}}-linux-amd64
- DIR=http
exec:
<<: *dockerbuild
dockerfile: exec/Dockerfile
image_name: service_catalog/exec
build_arguments:
- NAME=exec-${{SERVICE_EXEC_VERSION}}-linux-amd64
- DIR=exec
jira:
<<: *dockerbuild
dockerfile: jira/Dockerfile
image_name: service_catalog/jira
build_arguments:
- NAME=jira-${{SERVICE_JIRA_VERSION}}-linux-amd64
- DIR=jira
google-spreadsheet:
<<: *dockerbuild
dockerfile: google-spreadsheet/Dockerfile
image_name: service_catalog/google-spreadsheet
build_arguments:
- NAME=google-spreadsheet-${{SERVICE_GOOGLE_SPREADSHEET_VERSION}}-linux-amd64
- DIR=google-spreadsheet
google-calendar:
<<: *dockerbuild
dockerfile: google-calendar/Dockerfile
image_name: service_catalog/google-calendar
build_arguments:
- NAME=google-calendar-${{SERVICE_GOOGLE_CALENDAR_VERSION}}-linux-amd64
- DIR=google-calendar
trello:
<<: *dockerbuild
dockerfile: trello/Dockerfile
image_name: service_catalog/trello
build_arguments:
- NAME=trello-${{SERVICE_TRELLO_VERSION}}-linux-amd64
- DIR=trello
kubernetes:
<<: *dockerbuild
dockerfile: kubernetes/Dockerfile
image_name: service_catalog/kubernetes
build_arguments:
- NAME=kubernetes-${{SERVICE_KUBERNETES_VERSION}}-linux-amd64
- DIR=kubernetes
when:
branch:
only:
- master
PushImages:
stage: Push
title: Push All Docker Images To Dockerhub
type: parallel
steps:
push-git: &pushImage
title: "Push Docker Image"
type: push
candidate: ${{git}}
image_name: openintegration/service_catalog-git
registry: dockerhub
tags:
- latest
- ${{SERVICE_GIT_VERSION}}
push-jira:
<<: *pushImage
candidate: ${{jira}}
image_name: openintegration/service_catalog-jira
tags:
- latest
- ${{SERVICE_JIRA_VERSION}}
push-slack:
<<: *pushImage
candidate: ${{slack}}
image_name: openintegration/service_catalog-slack
tags:
- latest
- ${{SERVICE_SLACK_VERSION}}
push-http:
<<: *pushImage
candidate: ${{http}}
image_name: openintegration/service_catalog-http
tags:
- latest
- ${{SERVICE_HTTP_VERSION}}
push-exec:
<<: *pushImage
candidate: ${{exec}}
image_name: openintegration/service_catalog-exec
tags:
- latest
- ${{SERVICE_EXEC_VERSION}}
push-google-spreadsheet:
<<: *pushImage
candidate: ${{google-spreadsheet}}
image_name: openintegration/service_catalog-google-spreadsheet
tags:
- latest
- ${{SERVICE_GOOGLE_SPREADSHEET_VERSION}}
push-google-caledar:
<<: *pushImage
candidate: ${{google-calendar}}
image_name: openintegration/service_catalog-google-calendar
tags:
- latest
- ${{SERVICE_GOOGLE_CALENDAR_VERSION}}
push-trello:
<<: *pushImage
candidate: ${{trello}}
image_name: openintegration/service_catalog-trello
tags:
- latest
- ${{SERVICE_TRELLO_VERSION}}
push-kubernetes:
<<: *pushImage
candidate: ${{kubernetes}}
image_name: openintegration/service_catalog-kubernetes
tags:
- latest
- ${{SERVICE_KUBERNETES_VERSION}}
when:
branch:
only:
- master
CreateRelease:
stage: Push
title: Create Release
image: google/cloud-sdk
working_directory: ${{CloneServices}}
commands:
- echo "Running script"
- sh ./.scripts/publish.sh
when:
branch:
only:
- master