generated from axonivy-market/market-product
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
51 lines (45 loc) · 1.75 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
def manualDeploy
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '30'))
}
parameters {
string(name: 'engineSource', defaultValue: 'https://product.ivyteam.io', description: 'Engine page url')
string(name: 'deployTo', defaultValue: 'https://nightly.demo.ivyteam.io/', description: 'Deploy to host')
}
environment {
imgSimilarity = 98
dockerfileParams = '--shm-size 1g --hostname=ivy'
}
stages {
stage('build') {
steps {
script {
def deployApplicationName = env.BRANCH_NAME.replaceAll("%2F","_").replaceAll("/","_").replaceAll("\\.","_")
def random = (new Random()).nextInt(10000000)
def networkName = "build-" + random
def seleniumName = "selenium-" + random
def ivyName = "ivy-" + random
sh "docker network create ${networkName}"
try {
docker.image("selenium/standalone-firefox:3").withRun("-e START_XVFB=false --shm-size=2g --name ${seleniumName} --network ${networkName}") {
docker.build('maven').inside("--name ${ivyName} --network ${networkName}") {
maven cmd: 'clean verify ' +
'-Dmaven.test.failure.ignore=true ' +
"-DdeployApplicationName=msgraph-connector-${deployApplicationName} " +
"-Dengine.list.url=${params.engineSource} " +
"-Dtest.engine.url=http://${ivyName}:8080 " +
"-Dselenide.remote=http://${seleniumName}:4444/wd/hub " +
"-Divy.deploy.engine.url=${params.deployTo} " +
"-P demo.io"
}
}
} finally {
sh "docker network rm ${networkName}"
}
}
}
}
}
}