-
Notifications
You must be signed in to change notification settings - Fork 9
/
Jenkinsfile
44 lines (38 loc) · 1.98 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
@Library('ciElastestConnect') _
elastest_lib.setVersion('dev')
//initialization of the context for the library
elastest_lib.setContext(this)
elastest_lib.setAuthenticatedElastest(true)
//initialization of the runnable object to access elastest methods inside the pipeline
def elastest= elastest_lib.getElastestMethods()
elastest_lib.setMode('experimental-lite')
//definition of nodes is managed by the library. Just declare the steps of your pipeline
//inside the elastest_lib.pipeline({...})
elastest_lib.pipeline({
stage ('docker container')
def mycontainer = elastest.ctx.docker.image('elastest/ci-docker-e2e-compose-py:latest')
mycontainer.pull()
mycontainer.inside("-u jenkins -v /var/run/docker.sock:/var/run/docker.sock:rw -v /dev/shm:/dev/shm") {
sh '/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &'
stage ('prepare')
git 'https://github.com/elastest/elastest-device-emulator-service.git'
elastest.connect2ElastestNetwork()
def elastestUser = elastest.getElasTestUser()
def elastestPass = elastest.getElasTestPassword()
def elastestURL = "http://" + elastestUser +":"+ elastestPass+"@"+elastest.getIp()+":"+elastest.getPort()
stage ("E2E API tests")
try {
sh "cd demo/e2e_tests;python e2e_test_api.py ${elastestURL}"
} catch(e) {
sh '''\
docker ps --all
docker ps -a --filter name=etm -q
docker ps -a --filter name=rest_app -q | xargs -L 1 docker logs || true
docker ps --filter name=etm -q | xargs -L 1 docker inspect || true
'''
}
// sh "cd demo/e2e_tests;python e2e_test_api.py ${elastestURL}"
// stage ("E2E UI tests")
// sh "cd demo/e2e_tests;python e2e_test_ui.py ${elastestURL}"
}
})