-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
executable file
·33 lines (26 loc) · 1.38 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
node('docker'){
stage "Container Prep"
def mycontainer = docker.image('elastest/ci-docker-siblings:latest')
mycontainer.pull() // make sure we have the latest available from Docker Hub
mycontainer.inside("-u jenkins -v /var/run/docker.sock:/var/run/docker.sock:rw") {
git 'https://github.com/mpauls/epm-adapter-docker-compose'
stage "Build image - Package"
echo ("Building docker image...")
def myimage = docker.build("elastest/epm-adapter-docker-compose:latest")
stage "Run image"
echo "Run the image..."
myimage.run("-p 50051:50051 --expose 50051 -v /var/run/docker.sock:/var/run/docker.sock")
stage "Integration tests"
echo ("Starting integration tests...")
sh 'pip install grpcio'
//sh 'python -m tests.runtime_test'
stage "Publish"
echo ("Publishing as all tests succeeded...")
//this is work arround as withDockerRegistry is not working properly
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'elastestci-dockerhub',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
sh 'docker login -u "$USERNAME" -p "$PASSWORD"'
myimage.push()
}
}
}