-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathJenkinsfile
61 lines (61 loc) · 1.82 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
pipeline {
parameters {
string(name: 'TEST_DOCKER_IP', defaultValue: '10.3.199.246', description: 'Docker setup IP address to test on', trim: true)
string(name: 'TEST_NS_SINGLE', defaultValue: 'https://10.3.199.247:8443', description: 'Single NS API address', trim: true)
}
options {
disableConcurrentBuilds()
}
agent {
node {
label 'solutions-126'
}
}
stages {
stage('Build development') {
steps {
sh """
TEST_DOCKER_IP=${params.TEST_DOCKER_IP} \
TEST_NS_SINGLE=${params.TEST_NS_SINGLE} \
make print-variables
"""
sh 'make build-development'
}
}
stage('Push [local registry]') {
steps {
sh 'make push-development'
}
}
stage('Tests [unit]') {
steps {
sh 'make test-unit-container'
}
}
stage('Tests [e2e-docker]') {
steps {
sh "./tests/bash/generateConfig.sh tests/e2e/_configs/single-ns.yaml ${params.TEST_NS_SINGLE}"
sh "TEST_DOCKER_IP=${params.TEST_DOCKER_IP} make test-e2e-docker-development-container"
}
}
stage('Build production') {
steps {
sh 'make build-production'
}
}
stage('Push [hub.docker.com]') {
when {
branch 'master'
}
environment {
DOCKER = credentials('docker-hub-credentials')
}
steps {
sh '''
docker login -u ${DOCKER_USR} -p ${DOCKER_PSW};
make push-production;
'''
}
}
}
}