-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
43 lines (36 loc) · 1.01 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
#!groovy
properties(
[ [$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', daysToKeepStr: '30'] ]
, [$class: 'GithubProjectProperty', projectUrlStr: 'http://github.com/lstephen/docker-jenkins']
])
def construi(target) {
wrap([$class: 'AnsiColorBuildWrapper', colorMapName: 'xterm']) {
sh "construi ${target}"
}
}
stage 'Build'
node('construi') {
checkout scm
construi 'build'
}
if (env.BRANCH_NAME == 'master') {
stage 'Release'
node('construi') {
checkout scm
construi 'versiune'
currentBuild.description = "Release v${readFile('VERSION')}"
withCredentials(
[
[ $class: 'UsernamePasswordMultiBinding'
, usernameVariable: 'DOCKER_PUSH_USERNAME'
, passwordVariable: 'DOCKER_PUSH_PASSWORD'
, credentialsId: 'c61346cf-aca8-4ae6-bee8-e8ccf02eaa12'
]
, [ $class: 'FileBinding'
, variable: 'GIT_SSH_KEY'
, credentialsId: 'cfbecb37-737f-4597-86f7-43fb2d3322cc' ]
]) {
construi 'release'
}
}
}