Files
nodeMap/Jenkinsfile
2024-07-13 21:19:30 +02:00

62 lines
1.4 KiB
Groovy

Jenkinsfile (Declarative Pipeline)
/* Requires the Docker Pipeline plugin */
pipeline {
agent any
environment {
NODE_ENV = 'production'
}
stages {
stage('Checkout') {
steps {
// Code aus dem Repository holen
git branch: 'main2', url: 'http://localhost:3003/Ismail/NodeMap.git'
}
}
stage('Install Dependencies') {
steps {
script {
// Node.js Version setzen
nodejs('nodejs') {
// Abhängigkeiten installieren
sh 'npm install'
}
}
}
}
stage('Build') {
steps {
script {
nodejs('nodejs') {
// Projekt bauen
sh 'npm run build'
}
}
}
}
stage('Test') {
steps {
script {
nodejs('nodejs') {
// Tests ausführen
sh 'npm test'
}
}
}
}
}
post {
success {
echo 'Build and tests were successful!'
}
failure {
echo 'Build or tests failed.'
}
}
}