-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcd.yaml
69 lines (69 loc) · 2.04 KB
/
cd.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
apiVersion: devops.kubesphere.io/v1alpha3
kind: ClusterStepTemplate
metadata:
name: cd
labels:
step.devops.kubesphere.io/category: "Container"
annotations:
devops.kubesphere.io/displayNameEN: "CD"
devops.kubesphere.io/descriptionEN: "Update image information using continuous deployment"
devops.kubesphere.io/descriptionZH: "通过持续部署更新镜像信息"
devops.kubesphere.io/displayNameZH: "CD"
step.devops.kubesphere.io/icon: "rocket"
spec:
runtime: dsl
parameters:
- name: application
type: application
display: 'Continuous Deployments'
required: true
- name: branch
type: string
display: 'Branch'
required: true
- name: originalName
type: string
display: 'Original Image Address'
required: true
- name: newImageName
type: string
required: true
display: 'New Image Address'
- name: newImageTag
type: string
display: 'New Image Tag'
- name: secret
type: secret
display: 'Credential'
required: true
template: |
{
"arguments": {
"isLiteral": true,
"value": "base"
},
"children": [
{
"arguments": {
"isLiteral": false,
"value": "${[usernamePassword(credentialsId : '{{.param.secret.name}}' ,passwordVariable : 'PASS' ,usernameVariable : 'USER')]}"
},
"children": [
{
"arguments": [
{
"key": "script",
"value": {
"isLiteral": true,
"value": "ks app update --app-name {{.param.application.name}} \\\n --app-namespace {{.param.application.namespace}} \\\n --name {{.param.originalName}} \\\n --newName {{.param.newName}} \\\n --git-password $PASS --git-username=$USER \\\n --git-target-branch {{.param.branch}}"
}
}
],
"name": "sh"
}
],
"name": "withCredentials"
}
],
"name": "container"
}