Skip to content

Commit a090111

Browse files
committed
ci: test pipeline for manifest generation
Signed-off-by: Francesco Canovai <[email protected]>
1 parent 17dae37 commit a090111

File tree

2 files changed

+929
-3
lines changed

2 files changed

+929
-3
lines changed

Taskfile.yml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ tasks:
5050
uncommitted:
5151
desc: Check for uncommitted changes
5252
deps:
53-
- controller-gen
53+
- manifest-main
5454
env:
5555
# renovate: datasource=git-refs depName=uncommitted lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
5656
DAGGER_UNCOMMITTED_SHA: fa2e604b785c0ff9252a807097fc1215e10df486
@@ -214,7 +214,7 @@ tasks:
214214
- uncommitted
215215
- lint
216216
- go-test
217-
- e2e
217+
# - e2e
218218

219219
publish:
220220
desc: Build and publish a container image for the plugin
@@ -269,8 +269,23 @@ tasks:
269269
generates:
270270
- ./api/v1/zz_generated.deepcopy.go
271271

272+
manifest-main:
273+
deps:
274+
- controller-gen
275+
desc: Generate the manifest for the main branch
276+
vars:
277+
GITHUB_REPOSITORY: '{{ default "cloudnative-pg/plugin-barman-cloud" .GITHUB_REPOSITORY }}'
278+
GITHUB_REF: main
279+
GITHUB_REF_NAME: main
280+
cmds:
281+
- task: manifest-internal
282+
vars:
283+
GITHUB_REPOSITORY: '{{.GITHUB_REPOSITORY}}'
284+
GITHUB_REF: '{{.GITHUB_REF}}'
285+
GITHUB_REF_NAME: '{{.GITHUB_REF_NAME}}'
286+
272287
manifest:
273-
desc: Update the image in the Kustomization
288+
desc: Generate the manifest to be uploaded to the release or as a workflow artifact
274289
deps:
275290
- controller-gen
276291
requires:
@@ -281,6 +296,22 @@ tasks:
281296
- GITHUB_REPOSITORY
282297
- GITHUB_REF
283298
- GITHUB_REF_NAME
299+
cmds:
300+
- task: manifest-internal
301+
vars:
302+
GITHUB_REPOSITORY: '{{.GITHUB_REPOSITORY}}'
303+
GITHUB_REF: '{{.GITHUB_REF}}'
304+
GITHUB_REF_NAME: '{{.GITHUB_REF_NAME}}'
305+
306+
manifest-internal:
307+
desc: Update the image in the Kustomization
308+
label: manifest-internal-{{.GITHUB_REF_NAME}}
309+
internal: true
310+
requires:
311+
vars:
312+
- GITHUB_REPOSITORY
313+
- GITHUB_REF
314+
- GITHUB_REF_NAME
284315
vars:
285316
PLUGIN_IMAGE_NAME: ghcr.io/{{.GITHUB_REPOSITORY}}{{if not (hasPrefix "refs/tags/v" .GITHUB_REF)}}-testing{{end}}
286317
SIDECAR_IMAGE_NAME: ghcr.io/{{.GITHUB_REPOSITORY}}-sidecar{{if not (hasPrefix "refs/tags/v" .GITHUB_REF)}}-testing{{end}}
@@ -301,6 +332,12 @@ tasks:
301332
- >
302333
dagger -s call -m github.com/sagikazarmark/daggerverse/kustomize@${DAGGER_KUSTOMIZE_SHA}
303334
build --source . --dir manifest-build export --path manifest.yaml
335+
sources:
336+
- ./config/**/*.yaml
337+
- ./kubernetes/**/*.yaml
338+
generates:
339+
- ./manifest.yaml
340+
304341

305342
upload-manifest-to-release:
306343
desc: Upload the manifest to the release

0 commit comments

Comments
 (0)