Add Jenkinsfile: build/test/deploy pipeline

This commit is contained in:
hehihoho3 2026-06-16 12:22:57 +09:00
parent cc3904c307
commit 4508c3ef18

26
Jenkinsfile vendored Normal file
View 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
'''
}
}
}
}