-
Notifications
You must be signed in to change notification settings - Fork 4
/
JenkinsfileSut
42 lines (34 loc) · 1.95 KB
/
JenkinsfileSut
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
node('docker') {
stage "Container Prep"
echo("The node is up")
def mycontainer = docker.image('elastest/ci-docker-compose-py-siblings:latest')
mycontainer.pull()
mycontainer.inside("-u jenkins -v /var/run/docker.sock:/var/run/docker.sock:rw") {
git 'https://github.com/elastest/elastest-instrumentation-manager'
stage "Tests"
echo ("Starting tests")
echo ("(No tests yet)")
stage "Build eim-rest-api"
echo ("Build eim-rest-api")
sh 'cd ./eim/eim-rest-api; mvn clean package -DskipTests;'
stage "Build EIM SuT image - Package"
echo ("building sut..")
//def sut_image = docker.build("elastest/eim-sut:latest","./sut")
sh 'cd sut; docker build --build-arg GIT_COMMIT=$(git rev-parse HEAD) --build-arg COMMIT_DATE=$(git log -1 --format=%cd --date=format:%Y-%m-%dT%H:%M:%S) . -t elastest/eim-sut:latest'
def sut_image = docker.image('elastest/eim-sut:latest')
stage "Execute docker compose"
echo ("running docker compose..")
//sh 'docker-compose -f deploy/docker-compose.yml up -d --build'
sh 'docker-compose -f docker-compose-standalone.yml up -d --build'
stage "Publish"
echo ("Publishing")
withCredentials([[
$class: 'UsernamePasswordMultiBinding',
credentialsId: 'elastestci-dockerhub',
usernameVariable: 'USERNAME',
passwordVariable: 'PASSWORD']]) {
sh 'docker login -u "$USERNAME" -p "$PASSWORD"'
sut_image.push()
}
}
}