配置 Jenkins pipeline

This commit is contained in:
YuCheng Hu 2022-10-21 11:54:24 -04:00
parent bf4ccde35d
commit 574f467bc8
1 changed files with 44 additions and 0 deletions

44
Vuejs/Admin/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,44 @@
pipeline {
agent any
tools {
nodejs 'node'
}
environment {
DISABLE_AUTH = 'true'
DB_ENGINE = 'sqlite'
}
stages {
stage('CONFIG') {
steps {
echo 'Building..'
sh 'cd Vuejs/Admin'
sh 'yarn install'
sh 'npx browserslist@latest --update-db'
}
}
stage('BUILD VUE') {
steps {
echo 'Vue Building..'
sh 'yarn build'
}
}
stage('BUILD DOCKER') {
steps {
echo 'Testing..'
sh 'docker image prune -f'
sh 'docker build -f Dockerfile -t usvisartrack_ui:0.0.9 --label usvisartrack_ui .'
}
}
stage('DEPLOY DOCKER') {
steps {
echo 'Deploying....'
sh 'docker tag usvisartrack_ui:0.0.9 repo-docker.ossez.com/docker-hub/usvisartrack_ui:0.0.9'
sh 'docker push repo-docker.ossez.com/docker-hub/usvisartrack_ui:0.0.9'
}
}
}
}