forked from eformat/bluegreen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathab-pipeline.yaml
41 lines (41 loc) · 1.51 KB
/
ab-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
apiVersion: v1
kind: BuildConfig
metadata:
annotations:
pipeline.alpha.openshift.io/uses: '[{"name": "bluegreen", "namespace": "", "kind":
"DeploymentConfig"}]'
creationTimestamp: null
labels:
app: ab-pipeline
name: ab-pipeline
name: ab-pipeline
spec:
output: {}
postCommit: {}
resources: {}
runPolicy: Serial
source:
type: None
strategy:
jenkinsPipelineStrategy:
jenkinsfile: "#!groovy\ndef appName=\"main\"\n\nnode {\n def project =
getProjectName()\n \n stage(\"Set Route Backends\") {\n def userInput
= input(\n id: 'userInput', message: 'Let\\'s Adjust Routes ?', parameters:
[\n [$class: 'TextParameterDefinition', defaultValue: '100', description:
'Blue', name: 'blue'],\n [$class: 'TextParameterDefinition', defaultValue:
'0', description: 'Green', name: 'green']\n ]) \n echo (\"Blue: \"+userInput['blue'])\n
\ echo (\"Green: \"+userInput['green'])\n \n sh \"oc set -n ${project}
route-backends ${appName} blue=\"+userInput['blue']+\" green=\"+userInput['green']\n
\ }\n}\n\ndef getProjectName(){\n def cmd1 = $/project=$(oc get project
-o name);echo $${project##project*/} > projectName/$\n sh cmd1\n name
= readFile('projectName').trim()\n sh 'rm projectName'\n return name\n}\n"
type: JenkinsPipeline
triggers:
- github:
secret: secret101
type: GitHub
- generic:
secret: secret101
type: Generic
status:
lastVersion: 0