-
Notifications
You must be signed in to change notification settings - Fork 1
/
simple-openshift-pipeline.yaml
76 lines (76 loc) · 1.82 KB
/
simple-openshift-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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: ImageStream
metadata:
name: application
spec:
lookupPolicy:
local: false
- apiVersion: v1
kind: BuildConfig
metadata:
name: application
spec:
output:
to:
kind: ImageStreamTag
name: application:latest
source:
git:
uri: https://github.com/appuio/example-php-sti-helloworld.git
type: Git
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: php:7.0
namespace: openshift
type: Source
- apiVersion: v1
kind: BuildConfig
metadata:
name: appuio-sample-pipeline
spec:
strategy:
jenkinsPipelineStrategy:
jenkinsfile: |-
def project=""
node {
stage('Init') {
project = env.PROJECT_NAME
}
stage('Build') {
echo "Build"
openshift.withCluster() {
openshift.withProject() {
def builds = openshift.startBuild("application")
builds.logs('-f')
timeout(5) {
builds.untilEach(1) {
return (it.object().status.phase == "Complete")
}
}
}
}
}
stage('Test') {
echo "Test"
sleep 2
}
}
node ('maven') {
stage('DeployDev') {
echo "Deploy to Dev"
sleep 5
}
stage('PromoteTest') {
echo "Deploy to Test"
sleep 5
}
stage('PromoteProd') {
echo "Deploy to Prod"
sleep 5
}
}