-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
58 lines (52 loc) · 1.36 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
52
53
54
55
56
57
58
pipeline {
agent any
environment {
JENKINS_NODE_COOKIE = 'dontKillMe'
}
stages {
stage("checkout") {
steps {
checkout scm
}
}
stage("frontend-build") {
agent {
docker {
image "node:16-alpine"
reuseNode true
}
}
steps {
dir("app/src/main/pointer") {
sh "npm ci"
sh "npm run build"
}
}
}
stage("backend-build") {
agent {
docker {
image "openjdk:11-jdk"
reuseNode true
}
}
steps {
sh "./gradlew bootJar"
}
}
stage("deploy") {
steps {
sh "docker-compose up -d"
sh "docker run --rm -d -v $PWD/app/build/libs:/app -p ${PORT}:8080 openjdk:11-jdk java -jar -Dspring.profiles.active=${ENVIRONMENT} app/smartpointer_1.1.0.jar"
}
}
}
post {
always {
discordSend link: env.BUILD_URL,
result: currentBuild.currentResult,
title: JOB_NAME,
webhookURL: DISCORD_WEBHOOK_URL
}
}
}