2022-06-08 17:35:09 +00:00
|
|
|
pipeline {
|
2022-06-09 08:44:12 +00:00
|
|
|
agent any
|
2022-06-09 08:38:34 +00:00
|
|
|
|
2022-06-09 07:45:33 +00:00
|
|
|
stages {
|
2022-06-09 08:38:34 +00:00
|
|
|
stage('Install') {
|
2022-06-09 07:45:33 +00:00
|
|
|
steps {
|
2022-06-09 08:38:34 +00:00
|
|
|
sh 'npm install'
|
2022-06-09 07:45:33 +00:00
|
|
|
}
|
|
|
|
}
|
2022-06-09 08:38:34 +00:00
|
|
|
|
|
|
|
stage('Test') {
|
|
|
|
parallel {
|
|
|
|
stage('Static code analysis') {
|
|
|
|
steps {
|
|
|
|
sh 'npm run-script lint'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Unit tests') {
|
|
|
|
steps {
|
|
|
|
sh 'npm run-script test'
|
|
|
|
}
|
|
|
|
}
|
2022-06-09 07:45:33 +00:00
|
|
|
}
|
|
|
|
}
|
2022-06-09 08:38:34 +00:00
|
|
|
|
|
|
|
stage('Build') {
|
2022-06-09 07:45:33 +00:00
|
|
|
steps {
|
2022-06-09 08:38:34 +00:00
|
|
|
sh 'npm run-script build'
|
2022-06-09 08:42:23 +00:00
|
|
|
stash includes: 'dist/', name: 'dist'
|
2022-06-09 07:45:33 +00:00
|
|
|
}
|
|
|
|
}
|
2022-06-09 08:38:34 +00:00
|
|
|
|
|
|
|
stage('Build Docker Image') {
|
|
|
|
// environment {
|
|
|
|
// DOCKER_PUSH = credentials('docker_push')
|
|
|
|
// }
|
2022-06-09 08:06:50 +00:00
|
|
|
steps {
|
2022-06-09 08:20:46 +00:00
|
|
|
unstash 'dist'
|
2022-06-09 08:38:34 +00:00
|
|
|
// 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'
|
2022-06-09 08:06:50 +00:00
|
|
|
}
|
|
|
|
}
|
2022-06-09 07:45:33 +00:00
|
|
|
}
|
|
|
|
}
|