-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
56 lines (52 loc) · 1.41 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
def extensions = [
"dhis2harvester",
"scheming",
"validation",
"unaids",
"emailasusername"
]
pipeline {
agent any
triggers {
cron('H 23 * * 1-5')
}
stages {
stage('ADX setup tests') {
steps {
slackSend (color: '#FFFF00', message: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
dir('adx_develop') {
checkout scm
}
sshagent (['local-github-ssh']) {
echo 'Get ECR login'
sh """aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 254010146609.dkr.ecr.eu-west-1.amazonaws.com"""
echo 'Starting ADX setup'
sh """cd adx_develop && ./ci_setup.sh"""
}
}
}
stage('ADX run tests') {
steps {
script {
for (test in extensions) {
stage(test) {
sh """cd adx_develop && ./ci_test.sh ${test}"""
}
}
}
}
}
}
post {
always {
sh """cd $WORKSPACE/adx_develop &&docker-compose down --rmi all -v --remove-orphans"""
cleanWs()
}
success {
slackSend (color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
failure {
slackSend (color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
}