あなたは正しい、あなたは何ができるかJenkins Pipeline
でこれよりよく管理することができ、次のとおりです。
1)のdevの枝からコードをチェックアウトし、ワークスペース内のディレクトリに置きます。
2)そのディレクトリからコンパイルして展開します。
3)マスターブランチからの配布を承認するための手作業を追加します。
node {
// Get code from git repo
checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: "origin/dev"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'test-dev-dir']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '<jenkins-github-credential-id>', url: 'https://github.com/test']]]
dir('test-dir') {
// Do your stuff
}
// stage concurrency: 1, name: 'approve'
// input id: 'master-deploy', message: 'Deploy from master?', ok: 'Deploy'
// Get code from git repo
checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: "origin/master"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'test-master-dir']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '<jenkins-github-credential-id>', url: 'https://github.com/test']]]
dir('test-master-dir') {
// Preferbably create a tag for future hotfix maybe?
// Do your stuff
}
}
おかげでマニッシュ:
4)の手順を繰り返し1と2
サンプルコードは次のようになります。あなたはDevコードの変更をrepoに戻すためにどのようにプッシュしますか? –
私はこれがマージプロセスだと考えています。手動で解決する必要がある潜在的な競合がある可能性があるため、手動でマージする現在のプロセスに従うことをお勧めします。そのため、マニュアル承認プロセスを追加して、一部を統合したら展開を承認することができます。 –