forked from harness-community/gitness-lab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-deploy-pipeline.yaml
55 lines (52 loc) · 1.81 KB
/
build-deploy-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
kind: pipeline
spec:
stages:
- type: ci
spec:
steps:
- name: test
type: run
spec:
container: golang
script: |-
go test -v ./...
- name: build
type: plugin
spec:
name: docker
inputs:
insecure: true
repo: k3d-registry.localhost:5000/podinfo
registry: k3d-registry.localhost:5000
tags: ${{ build.number }}
- name: deploy
type: plugin
spec:
name: helm3
inputs:
add_repos: "podinfo=https://stefanprodan.github.io/podinfo"
chart: podinfo/podinfo
kube_api_server: "https://host.docker.internal:9090"
kube_service_account: gitness-sa
kube_token: ${{ secrets.get('kube_token') }}
mode: upgrade
namespace: gitness
release: my-project
skip_tls_verify: true
values: image.repository=k3d-registry.localhost:5000/podinfo,image.tag=${{ build.number }},ui.message=Hello 👋 from build ${{ build.number }}
when:
build.event == "manual" and build.branch == "master"
- name: notify
type: plugin
when: failure()
spec:
name: webhook
inputs:
content_type: application/json
urls: ${{ secrets.get("webhook_url") }}
template: |
Name: Gitness Notification
Repo Name: {{ repo.name }}
Build Number {{ build.number }}
Build Event: {{ build.event }}
Build Status: {{ build.status }}