schedulord-frontend/Jenkinsfile
Jesse James Isler 02dbee085f
Some checks failed
gitea_dndsources/schedulord-frontend/pipeline/head There was a failure building this commit
:/
2022-06-09 11:14:21 +02:00

67 lines
1.6 KiB
Groovy

pipeline {
agent none
stages {
stage('Install') {
agent {
docker {
image 'node:lts-bullseye-slim'
args '-p 3000:3000'
}
}
steps {
sh 'npm install'
stash includes: 'node_modules/', name: 'node_modules'
}
}
stage('Static code analysis') {
agent {
docker {
image 'node:lts-bullseye-slim'
args '-p 3000:3000'
}
}
steps {
unstash 'node_modules'
sh 'npm run-script lint'
stash includes: 'node_modules/', name: 'node_modules'
}
}
stage('Unit tests') {
agent {
docker {
image 'node:lts-bullseye-slim'
args '-p 3000:3000'
}
}
steps {
unstash 'node_modules'
sh 'npm run-script test'
stash includes: 'node_modules/', name: 'node_modules'
}
}
stage('Build') {
steps {
unstash 'node_modules'
sh 'npm run-script build'
stash includes: 'dist/', name: 'dist'
}
}
stage('Build Docker Image') {
// environment {
// DOCKER_PUSH = credentials('docker_push')
// }
steps {
unstash 'dist'
// sh 'docker build -t $DOCKER_PUSH_URL/frontend .'
sh 'docker build .'
// sh 'docker login -u $DOCKER_PUSH_USR -p $DOCKER_PUSH_PSW $DOCKER_PUSH_URL'
// sh 'docker push $DOCKER_PUSH_URL/frontend'
}
}
}
}