Add Jenkinsfile: build/test/deploy pipeline
This commit is contained in:
parent
cc3904c307
commit
4508c3ef18
26
Jenkinsfile
vendored
Normal file
26
Jenkinsfile
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
options {
|
||||||
|
timestamps()
|
||||||
|
disableConcurrentBuilds()
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Build & Test') {
|
||||||
|
steps {
|
||||||
|
sh 'chmod +x gradlew'
|
||||||
|
sh './gradlew clean build --no-daemon'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
set -e
|
||||||
|
JAR=$(ls build/libs/h-lab-*.jar | grep -v plain | head -1)
|
||||||
|
echo "Deploying: $JAR"
|
||||||
|
docker cp "$JAR" springboot-app:/app/app.jar
|
||||||
|
docker restart springboot-app
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user