Jenkinsfile 690 B

12345678910111213141516171819202122232425262728
  1. pipeline {
  2. agent any
  3. environment {
  4. BRANCH_NAME="${env.BRANCH_NAME}".toLowerCase()
  5. }
  6. stages {
  7. stage('Build') {
  8. steps {
  9. nodejs('20.6.0') {
  10. sh 'npm install --registry https://registry.npm.taobao.org'
  11. sh 'npm run build:dev'
  12. }
  13. sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
  14. }
  15. }
  16. stage('Test') {
  17. steps {
  18. echo 'Testing..'
  19. }
  20. }
  21. stage('Deploy') {
  22. steps {
  23. echo 'Deploying....'
  24. sh 'docker-compose up -d'
  25. }
  26. }
  27. }
  28. }