This repository has been archived by the owner on Mar 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Jenkinsfile
47 lines (40 loc) · 1.85 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
properties([
buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5'))
])
//We need a node so that we can have access to environemnt variables.
//The allocated node will actually be the Jenkins master (which is expected to provide these variables) as long as it has available executors.
node {
def branch = "${env.BRANCH_NAME}"
echo "Using branch: ${branch}."
slave {
withOpenshift {
withMaven(
envVars: [
containerEnvVar(key:'GITHUB_OAUTH_CLIENT_ID', value: "${env.GITHUB_OAUTH_CLIENT_ID}"),
containerEnvVar(key:'GITHUB_OAUTH_CLIENT_SECRET', value: "${env.GITHUB_OAUTH_CLIENT_SECRET}")
],
serviceAccount: "jenkins", mavenSettingsXmlSecret: 'm2-settings', mavenLocalRepositoryPath: '/home/jenkins/mvnrepo/') {
inside {
def testingNamespace = generateProjectName()
checkout scm
stage('Build') {
container(name: 'maven') {
sh "mvn -B -U clean install fabric8:build -Pci -Duser.home=/home/jenkins"
}
}
stage('System Tests') {
test(component: 'syndesis-rest', namespace: "${testingNamespace}", serviceAccount: 'jenkins')
}
if ("master" == branch) {
stage('Rollout') {
tag(sourceProject: 'syndesis-ci', imageStream: 'syndesis-rest')
rollout(deploymentConfig: 'syndesis-rest', namespace: 'syndesis-staging')
}
} else {
echo "Branch: ${branch} is not master. Skipping rollout"
}
}
}
}
}
}