123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- pipeline {
- agent none
- stages {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- stage('main build') {
- when {
- branch 'main'
- beforeAgent true
- }
-
- agent { label 'devPhp80' }
-
-
-
-
-
-
-
-
- steps {
- echo 'master step执行完了'
- }
- }
-
- stage('test build') {
- when {
- branch 'test'
- beforeAgent true
- }
-
- agent { label 'devPhp80' }
-
-
-
-
-
-
-
-
- steps {
- echo '拷贝后端测试环境变量'
- sh '''
- cd api
- cp ./dotenv/.test.env .env
- cd ..
- '''
- echo '拷贝后台测试环境变量'
- sh '''
- cd h5
- cp ./dotenv/.test-on-server.env .env
- cd ..
- '''
- echo '构建前端'
- echo 'test step执行完了'
- }
- }
-
- stage('after build') {
- agent any
- steps {
- echo '结束了Always excecute after other stages.'
- }
- }
- }
-
- post {
-
- failure {
- echo 'FAILURE MESSAGE'
- }
-
- success {
- echo 'SUCCESS MESSAGE'
- }
- }
- }
|