Jenkinsfile 1005 B

1234567891011121314151617181920212223242526272829303132333435
  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.17.0') {
  11. sh 'npm -v'
  12. sh 'node -v'
  13. sh 'yarn -v'
  14. sh 'npm install yarn -g --registry https://registry.npm.taobao.org'
  15. sh 'yarn config set registry https://registry.npm.taobao.org/'
  16. sh 'yarn install'
  17. sh 'yarn add async-validator@1.11.5'
  18. sh 'yarn run build:prod'
  19. }
  20. sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
  21. }
  22. }
  23. stage('Test') {
  24. steps {
  25. echo 'Testing..'
  26. }
  27. }
  28. stage('Deploy') {
  29. steps {
  30. echo 'Deploying....'
  31. sh 'docker-compose up -d'
  32. }
  33. }
  34. }
  35. }