👷 Add jenkinsfile
This commit is contained in:
parent
db77add4db
commit
15859815bc
@ -7,7 +7,7 @@
|
||||
#
|
||||
# Then, build the image with:
|
||||
#
|
||||
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/kubeman-jvm .
|
||||
# docker build -f src/main/docker/Dockerfile -t quarkus/kubeman-jvm .
|
||||
#
|
||||
# Then run the container using:
|
||||
#
|
||||
38
Jenkinsfile
vendored
Normal file
38
Jenkinsfile
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Set Image Name') {
|
||||
steps {
|
||||
script {
|
||||
env.IMAGE = "harbor.dinauer.dev/kubooboo/backend:${env.BUILD_NUMBER}";
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build Quarkus application') {
|
||||
steps {
|
||||
script {
|
||||
sh 'mvn clean install'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build Docker Image') {
|
||||
steps {
|
||||
script {
|
||||
sh "docker build --no-cache -t ${env.IMAGE} ."
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Push Image to Docker Hub') {
|
||||
steps {
|
||||
script {
|
||||
withCredentials([usernamePassword(credentialsId: 'harbor', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
|
||||
sh 'echo ${PASSWORD} | docker login harbor.dinauer.dev -u ${USERNAME} --password-stdin'
|
||||
sh "docker push ${env.IMAGE}"
|
||||
sh "docker logout"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user