123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #!groovy
- pipeline {
- agent any
- parameters {
- string(name: 'TAG_NAME', defaultValue: '', description: '')
- }
- environment
-
- DOCKER_CREDENTIAL_ID
-
- GITHUB_CREDENTIAL_ID
-
- KUBECONFIG_CREDENTIAL_ID
-
- REGISTRY
-
- DOCKERHUB_NAMESPACE
-
- GITHUB_ACCOUNT
-
- APP_NAME
-
- APP_DEPLOY_BASE_DIR
- }
- stages
- stage('检出') {
- steps
- git
- branch: "devops"
- }
- }
- stage('构建') {
- steps
-
- sh
- ' echo "配置文件不存在无需修改"\n' +
- 'else\n' +
- ' cp -rf ' + "${env.HOME}" + '/resources/*.yaml ' + "${env.APP_NAME}" + '/src/main/resources\n' +
- ' echo "配置文件替换"\n' +
- 'fi'
- sh
- }
- }
- stage('部署') {
- steps
- sh
- sh
- archiveArtifacts
- sh
- sh
- }
- }
- }
- }
|