This repository has been archived by the owner on Jun 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
53 lines (47 loc) · 1.73 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
properties([
parameters ([
string(name: 'BUILD_NODE', defaultValue: 'omar-build', description: 'The build node to run on'),
booleanParam(name: 'CLEAN_WORKSPACE', defaultValue: true, description: 'Clean the workspace at the end of the run')
]),
pipelineTriggers([
[$class: "GitHubPushTrigger"]
]),
[$class: 'GithubProjectProperty', displayName: '', projectUrlStr: 'https://github.com/ossimlabs/rhel-minimal'],
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '3', daysToKeepStr: '', numToKeepStr: '20')),
disableConcurrentBuilds()
])
node("${BUILD_NODE}"){
stage("Checkout branch $BRANCH_NAME")
{
checkout(scm)
}
stage("Load Variables")
{
withCredentials([string(credentialsId: 'o2-artifact-project', variable: 'o2ArtifactProject')]) {
step ([$class: "CopyArtifact",
projectName: o2ArtifactProject,
filter: "common-variables.groovy",
flatten: true])
}
load "common-variables.groovy"
}
stage ("Publish Docker App")
{
withCredentials([[$class: 'UsernamePasswordMultiBinding',
credentialsId: 'dockerCredentials',
usernameVariable: 'DOCKER_REGISTRY_USERNAME',
passwordVariable: 'DOCKER_REGISTRY_PASSWORD']])
{
// Run all tasks on the app. This includes pushing to OpenShift and S3.
sh """
gradle pushDockerImage \
-PossimMavenProxy=${OSSIM_MAVEN_PROXY}
"""
}
}
stage("Clean Workspace")
{
if ("${CLEAN_WORKSPACE}" == "true")
step([$class: 'WsCleanup'])
}
}