12345678910111213141516171819202122232425262728293031 |
- pipeline {
- agent any
- environment {
- BRANCH_NAME="${env.BRANCH_NAME}".toLowerCase()
- }
- stages {
- stage('Build') {
- steps {
- sh 'docker-compose down'
- nodejs('16.19.0') {
- sh 'npm install yarn -g --registry https://registry.npm.taobao.org'
- sh 'yarn config set registry https://registry.npm.taobao.org/'
- sh 'yarn install'
- sh 'yarn run build:prod'
- }
- sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
- }
- }
- stage('Test') {
- steps {
- echo 'Testing..'
- }
- }
- stage('Deploy') {
- steps {
- echo 'Deploying....'
- sh 'docker-compose up -d'
- }
- }
- }
- }
|