【发布时间】:2020-04-07 09:40:06
【问题描述】:
我是 Jenkins nooooobie。是否有可能/无痛地将这两个 yaml 文件合并到一个仓库中,这样当我推送到分支“登台”时,詹金斯将其推送到登台服务器,而当我推送到分支“生产”时,詹金斯推送到生产服务器?
分期
jenkins:
project: "Docker Slot StageSlot1 (WestUS)"
certbot_url: "https://cert.bots.company.com/"
certbot_token: "company-certbot-token"
domain_file: domain.yaml
docker:
ucp: "tcp://ucp-companydocker.westus.cloudapp.azure.com:443"
dtr: dtr-companydocker.westus.cloudapp.azure.com
ucpid: companyucpdockerwestus
dtrid: jenkinscompanydtrwestus
stackname: COMPANY-SS1-Staging
dockerfile: Dockerfile.build.tmpl
compose: docker-compose-ss1
dtrtag: "/company/stagslot"
ext_port: 8310
ext_https_port: 8311
build_cmd: ""
label: "/Staging/COMPANY/SS1"
cnt: 2
dir_rand: PM25SS1
siteurl: "http://company-ss1-stage.trafficmanager.net"
build_cache: false
slack:
channel: "#webops"
log_errors: false
git:
gitid: company-ss1-id
giturl: "git@github.com:company/company-SS1.git"
gitbranch: staging
生产
jenkins:
project: "Docker Slot ProdSlot1"
certbot_url: "https://cert.bots.company.com/"
certbot_token: "company-certbot-token"
domain_file: domain.yaml
docker:
dockerfile: Dockerfile.build.tmpl
build_cmd: ""
cnt: 4
dir_rand: PM25MS1
siteurl: "http://company-prodslot1.us-west1.gce.companyp.cloud"
build_cache: false
k8s:
gcpid: 'gcp-web-platform'
namespace: 'production'
site: 'ms-01'
env: 'prod'
clusters:
- name: 'gke-web-1'
region: 'us-west1'
slothost: 'company-ms01.us-west1.gce.companyp.cloud'
- name: 'gke-web-2'
region: 'us-central1'
slothost: 'company-ms01.us-central1.gce.companyp.cloud'
slack:
channel: "#webops"
log_errors: false
git:
gitid: company-prodslot1-id
giturl: "git@github.com:company/company-prodslot1.git"
gitbranch: production
【问题讨论】: