forked from panvicka/selector-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (61 loc) · 2.11 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
/* groovylint-disable-next-line LineLength */
/* groovylint-disable CompileStatic, DuplicateStringLiteral, NoDef, UnusedVariable, VariableName, VariableTypeRequired */
@Library('[email protected]') _
pipeline {
agent {
label 'docker'
}
options {
ansiColor('xterm')
buildDiscarder(
logRotator(
artifactDaysToKeepStr: '',
artifactNumToKeepStr: '',
daysToKeepStr: '1',
numToKeepStr: '10'
)
)
disableConcurrentBuilds()
}
environment {
// https://bitbucket.org/bitgrip/bitgrip-pipeline-global/src/master/#markdown-header-bitgripgetuserid
DOCKER_USER = bitgripGetUserId(this)
// https://bitbucket.org/bitgrip/bitgrip-pipeline-global/src/master/#markdown-header-bitgripgetgroupid
DOCKER_GROUP = bitgripGetGroupId(this, [groupname: 'docker'])
SELECTOR_BACKEND_IMAGE = 'bitgrip/selector-backend'
SELECTOR_BACKEND_VERSION = '1.0.0'
ANSIBLE_FORCE_COLOR = true
DOCKER_IMAGE_BUILD_NAME = 'docker:20.10.17-cli-alpine3.16'
}
stages {
stage('Build image') {
agent {
docker {
image DOCKER_IMAGE_BUILD_NAME
args "-u ${DOCKER_USER}:${DOCKER_GROUP} -v /var/run/docker.sock:/var/run/docker.sock"
reuseNode true
}
}
steps {
script {
bitgripBuildDockerImage(this, [
imageName: "${env.SELECTOR_BACKEND_IMAGE}",
imageVersion: "${env.SELECTOR_BACKEND_VERSION}"
])
}
}
}
stage('Deploy') {
steps {
build(
quietPeriod: 0,
job: 'bitgrip/bitgrip-operations/main',
parameters: [
string(name: 'PLAYBOOK', value: 'deploy-selector'),
string(name: 'EXTRA_VARS', value: '')
]
)
}
}
}
}