This repository has been archived by the owner on Apr 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
95 lines (89 loc) · 3.12 KB
/
Jenkinsfile
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
pipeline {
options {
disableConcurrentBuilds()
}
agent {
label "jenkins-maven-java11"
}
environment {
ORG = 'activiti'
APP_NAME = 'activiti-cloud-full-example'
GITHUB_CHARTS_REPO = "https://github.com/Activiti/activiti-cloud-helm-charts.git"
GITHUB_HELM_REPO_URL = "https://activiti.github.io/activiti-cloud-helm-charts/"
HELM_RELEASE_NAME = "example-$BRANCH_NAME-$BUILD_NUMBER".toLowerCase()
PREVIEW_VERSION = "0.0.0-SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER"
PREVIEW_NAMESPACE = "example-$BRANCH_NAME-$BUILD_NUMBER".toLowerCase()
GLOBAL_GATEWAY_DOMAIN="35.228.195.195.nip.io"
REALM = "activiti"
}
stages {
stage('CI Build and push snapshot') {
when {
branch 'PR-*'
}
environment {
GATEWAY_HOST = "activiti-cloud-gateway.$PREVIEW_NAMESPACE-security.$GLOBAL_GATEWAY_DOMAIN"
SSO_HOST = "activiti-cloud-gateway.$PREVIEW_NAMESPACE-security.$GLOBAL_GATEWAY_DOMAIN"
}
steps {
container('maven') {
sh 'make validate'
dir ("./charts/$APP_NAME") {
// sh 'make build'
sh 'make install-security'
}
dir("./activiti-cloud-acceptance-scenarios") {
git 'https://github.com/Activiti/activiti-cloud-acceptance-scenarios.git'
sh "mvn clean install -DskipTests && mvn -pl 'security-policies-acceptance-tests' clean verify"
}
}
}
}
stage('Build Release') {
when {
branch 'master'
}
environment {
GATEWAY_HOST = "activiti-cloud-gateway.$PREVIEW_NAMESPACE-security.$GLOBAL_GATEWAY_DOMAIN"
SSO_HOST = "activiti-cloud-gateway.$PREVIEW_NAMESPACE-security.$GLOBAL_GATEWAY_DOMAIN"
}
steps {
container('maven') {
// ensure we're not on a detached head
sh "git checkout master"
sh "git config --global credential.helper store"
sh "jx step git credentials"
// so we can retrieve the version in later steps
sh "echo \$(jx-release-version) > VERSION"
//RUNTIME bundle tests
dir ("./charts/$APP_NAME") {
// sh 'make build'
sh 'make install-security'
}
dir("./activiti-cloud-acceptance-scenarios") {
git 'https://github.com/Activiti/activiti-cloud-acceptance-scenarios.git'
sh "mvn clean install -DskipTests && mvn -pl 'security-policies-acceptance-tests' clean verify"
}
}
}
}
}
post {
failure {
slackSend(
channel: "#activiti-community-builds",
color: "danger",
message: "activiti-cloud-full-chart-security is failed $BUILD_URL"
)
}
always {
container('maven') {
dir("./charts/$APP_NAME") {
sh "make delete-security"
}
sh "kubectl delete namespace $PREVIEW_NAMESPACE-security"
}
cleanWs()
}
}
}