-
Notifications
You must be signed in to change notification settings - Fork 35
/
Jenkinsfile
86 lines (78 loc) · 3.43 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
pipeline {
agent { label 'docker' }
post {
always {
script{
def secrets = [
[path: "DevOps/RELEASE_VERSIONS", engineVersion: 2, secretValues: [
[envVar: 'ONEC_VERSION', vaultKey: 'ONEC']
]],
[path: "DevOps/ONEC_RELEASE", engineVersion: 2, secretValues: [
[envVar: 'ONEC_USERNAME', vaultKey: 'user'],
[envVar: 'ONEC_PASSWORD', vaultKey: 'password']]]
]
withVault([configuration: [timeout: 60], vaultSecrets: secrets ]){
sh "docker-compose --project-name $BUILD_TAG --file tools/docker/onec/docker-compose.yml down"
}
}
junit allowEmptyResults: true, testResults: '**/tests*.xml'
}
}
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 90, unit: 'MINUTES')
timestamps()
}
environment {
ONEC_VERSION = vault path: "DevOps/RELEASE_VERSIONS", key: 'ONEC'
}
stages {
stage('onec prepare') {
steps {
script{
def secrets = [
[path: "DevOps/ONEC_RELEASE", engineVersion: 2, secretValues: [
[envVar: 'ONEC_USERNAME', vaultKey: 'user'],
[envVar: 'ONEC_PASSWORD', vaultKey: 'password']]]
]
withVault([configuration: [timeout: 60], vaultSecrets: secrets ]){
sh 'docker-compose --file tools/docker/onec/docker-compose.yml pull'
sh "docker-compose --project-name $BUILD_TAG --file tools/docker/onec/docker-compose.yml up -d"
}
}
}
}
stage('BDD testing') {
steps {
echo 'Starting to build docker image'
script {
def secrets = [
[path: "infastructure/gitlab", engineVersion: 2, secretValues: [
[envVar: 'CI_BOT_TOKEN', vaultKey: 'ci-bot']
]]]
withVault([configuration: [timeout: 60], vaultSecrets: secrets ]){
withDockerContainer(args: "--network ${BUILD_TAG}_onec-net", image: 'registry.oskk.1solution.ru/docker-images/onec-oscript:8.3.14.1993-1.3.0') {
sh '1bdd exec -junit-out tests_bdd.xml ./features '
}
}
}
}
}
stage('TDD testing') {
steps {
echo 'Starting to build docker image'
script {
def secrets = [
[path: "infastructure/gitlab", engineVersion: 2, secretValues: [
[envVar: 'CI_BOT_TOKEN', vaultKey: 'ci-bot']
]]]
withVault([configuration: [timeout: 60], vaultSecrets: secrets ]){
withDockerContainer(args: "--network ${BUILD_TAG}_onec-net", image: 'registry.oskk.1solution.ru/docker-images/onec-oscript:8.3.14.1993-1.3.0') {
sh '1testrunner -runall ./tests xddReportPath .'
}
}
}
}
}
}
}