added tools
Some checks failed
gitea_dndsources/schedulord-frontend/pipeline/head There was a failure building this commit
Some checks failed
gitea_dndsources/schedulord-frontend/pipeline/head There was a failure building this commit
This commit is contained in:
parent
02dbee085f
commit
3194710388
83
Jenkinsfile
vendored
83
Jenkinsfile
vendored
@ -1,66 +1,31 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent none
|
agent any
|
||||||
|
tools {
|
||||||
|
nodejs "node"
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Install') {
|
stage('NPM Install') {
|
||||||
agent {
|
withEnv(["NPM_CONFIG_LOGLEVEL=warn"]) {
|
||||||
docker {
|
sh 'npm install'
|
||||||
image 'node:lts-bullseye-slim'
|
}
|
||||||
args '-p 3000:3000'
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
sh 'npm install'
|
|
||||||
stash includes: 'node_modules/', name: 'node_modules'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Static code analysis') {
|
stage('Test') {
|
||||||
agent {
|
withEnv(["CHROME_BIN=/usr/bin/chromium-browser"]) {
|
||||||
docker {
|
sh 'ng test --progress=false --watch false'
|
||||||
image 'node:lts-bullseye-slim'
|
}
|
||||||
args '-p 3000:3000'
|
junit '**/test-results.xml'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
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') {
|
stage('Lint') {
|
||||||
steps {
|
sh 'ng lint'
|
||||||
unstash 'node_modules'
|
}
|
||||||
sh 'npm run-script build'
|
|
||||||
stash includes: 'dist/', name: 'dist'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build Docker Image') {
|
stage('Build') {
|
||||||
// environment {
|
milestone()
|
||||||
// DOCKER_PUSH = credentials('docker_push')
|
sh 'ng build --prod --aot --sm --progress=false'
|
||||||
// }
|
}
|
||||||
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'
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user