Jenkinsfile 907 B

1234567891011121314151617181920212223242526272829303132
  1. pipeline {
  2. agent any
  3. environment {
  4. BRANCH_NAME="${env.BRANCH_NAME}".toLowerCase()
  5. }
  6. stages {
  7. stage('Build') {
  8. steps {
  9. sh 'docker-compose down'
  10. nodejs('16.19.0') {
  11. sh 'npm install yarn -g --registry https://registry.npm.taobao.org'
  12. sh 'yarn config set registry https://registry.npm.taobao.org/'
  13. sh 'yarn install'
  14. sh 'yarn add async-validator@1.11.5'
  15. sh 'yarn run build:prod'
  16. }
  17. sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
  18. }
  19. }
  20. stage('Test') {
  21. steps {
  22. echo 'Testing..'
  23. }
  24. }
  25. stage('Deploy') {
  26. steps {
  27. echo 'Deploying....'
  28. sh 'docker-compose up -d'
  29. }
  30. }
  31. }
  32. }