-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
44 lines (37 loc) · 1.24 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
def PROJECT = 'graphwiki-ui'
def API_PROJECT_GIT_REPOSITORY = 'https://github.com/opendatalabcz/graphwiki-api.git'
def UI_PROJECT_GIT_REPOSITORY = 'https://github.com/opendatalabcz/graphwiki-ui.git'
def GIT_CREDENTIALS = 'github_GregerTomas'
node {
dir ('wrapper-dir') {
dir ('api') {
git(
url: API_PROJECT_GIT_REPOSITORY,
credentialsId: GIT_CREDENTIALS
)
stage('MVN package') {
sh 'mvn clean package'
}
}
dir ('ui') {
git(
url: UI_PROJECT_GIT_REPOSITORY,
credentialsId: GIT_CREDENTIALS
)
stage('NPM install') {
sh 'npm install'
}
stage('NPM build') {
sh 'npm run build'
}
stage('DOCKER image') {
sh "docker build -t ${PROJECT}-image ."
}
stage('DOCKER run container') {
sh "docker container stop ${PROJECT}-container > /dev/null 2>&1 && echo \"Container stopped\" || echo \"Nothing to stop\""
sh "docker container rm ${PROJECT}-container > /dev/null 2>&1 && echo \"Container removed\" || echo \"Nothing to remove\""
sh "docker run --name ${PROJECT}-container -d -p 4200:80 ${PROJECT}-image"
}
}
}
}