This repository has been archived by the owner on Feb 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathJenkinsfile
50 lines (50 loc) · 1.48 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
pipeline {
agent { label 'linux-docker' }
options {
timeout(time: 1, unit: 'HOURS')
disableConcurrentBuilds()
buildDiscarder(logRotator(artifactNumToKeepStr: '5', numToKeepStr: '20'))
}
environment {
TAG = "${BRANCH_NAME}-${BUILD_NUMBER}"
PROJECT_NAME = "esg-grafana"
VERSION = "3.0"
QUIET = "yes"
}
stages {
stage('Run docker builds') {
steps {
sh'''
# Overwrite the default environment options
sed --in-place \
-e "s/^TAG=.*/TAG=${TAG}/" \
-e "s/^PROJ_NAME=.*/PROJ_NAME=${PROJECT_NAME}/" \
.env
cat .env
make build
'''
sh 'echo ${GIT_COMMIT}'
}
}
stage('Run python unit tests') {
steps {
sh'''
# Overwrite the default environment options
sed --in-place \
-e "s/^TAG=.*/TAG=${TAG}/" \
-e "s/^PROJ_NAME=.*/PROJ_NAME=${PROJECT_NAME}/" \
.env
./plugins/eseries_monitoring/collector/tests/initiate_testing.sh ${PROJECT_NAME} ${TAG}
'''
}
}
}
post {
always {
sh'''
make clean || true
'''
cleanWs deleteDirs: true
}
}
}