Init Jenkinsfile

This commit is contained in:
!verity
2026-03-16 21:34:37 +01:00
parent 2045808f00
commit 0ed51fa53e

52
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,52 @@
pipeline {
agent any
environment {
DEPLOY_DIR = '/var/www/portfolio'
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Install') {
steps {
sh 'npm install'
}
}
stage('Build') {
steps {
sh 'npm run build'
}
}
stage('Deploy') {
steps {
sh '''
rm -rf ${DEPLOY_DIR}/*
cp -r .next ${DEPLOY_DIR}/
cp -r public ${DEPLOY_DIR}/ 2>/dev/null || true
cp package.json ${DEPLOY_DIR}/
cp -r node_modules ${DEPLOY_DIR}/
cd ${DEPLOY_DIR}
pm2 delete portfolio || true
pm2 start npm --name portfolio -- start -- -p 3333
pm2 save
'''
}
}
}
post {
success {
echo '✅ Portfolio deployed!'
}
failure {
echo '❌ Deploy fehlgeschlagen!'
}
}
}