👷 Add Pipeline files

This commit is contained in:
Andreas Dinauer 2026-03-22 09:18:35 +01:00
parent 973aafe5fd
commit 322bfcb702
2 changed files with 55 additions and 0 deletions

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM node:22-alpine
WORKDIR /usr/app
COPY . .
ARG VERSION
RUN npm install
RUN npx nuxi cleanup
RUN npx nuxi build
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]

38
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,38 @@
pipeline {
agent any
stages {
stage('Set Image Name') {
steps {
script {
env.IMAGE = "harbor.dinauer.dev/verifoo/frontend-admin:${env.BUILD_NUMBER}";
}
}
}
stage('Build 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 harbor.dinauer.dev"
}
}
}
}
stage('Remove image from host') {
steps {
script {
sh "docker image rm --force ${env.IMAGE}"
}
}
}
}
}