Jenkinsfile 779 B

123456789101112131415161718192021222324252627282930
  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. checkout scm
  11. sh 'npm install -g pnpm --registry https://registry.npm.taobao.org'
  12. sh 'pnpm install --registry https://registry.npm.taobao.org'
  13. sh 'pnpm build:dev'
  14. }
  15. sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
  16. }
  17. }
  18. stage('Test') {
  19. steps {
  20. echo 'Testing..'
  21. }
  22. }
  23. stage('Deploy') {
  24. steps {
  25. echo 'Deploying....'
  26. sh 'docker-compose up -d'
  27. }
  28. }
  29. }
  30. }