forked from ticdat/ticdat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
47 lines (42 loc) · 1.29 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
pipeline {
agent {
docker {
image 'python:3.8'
args '-v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker'
}
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
}
stages {
stage('Checkout'){
steps {
checkout scm
}
}
stage('Build'){
steps {
echo 'Building docker image'
withDockerRegistry([ credentialsId: "DockerHubLogin", url: "" ]) {
sh 'docker build --no-cache --force-rm --rm=true -f Dockerfile -t opexanalytics/ticdat:'+env.BRANCH_NAME+' .'
}
}
}
stage('Push'){
steps {
echo 'Push to docker registries'
withDockerRegistry([ credentialsId: "DockerHubLogin", url: "" ]) {
sh 'docker push opexanalytics/ticdat:'+env.BRANCH_NAME
}
}
}
stage('Run'){
steps {
echo 'Run tests'
withDockerRegistry([ credentialsId: "DockerHubLogin", url: "" ]) {
sh 'docker run opexanalytics/ticdat:'+env.BRANCH_NAME
}
}
}
}
}