我在玩google cloud build。在我的用例中,我必须在构建期间更改一个文件并将其提交到Git中。
我画了下面的构建步骤,它们可以工作。但这是一个简单的Git承诺的很多仪式。
你有什么建议如何缩短这些东西吗?
steps:
- name: alpine
args: ["touch", "some-file.txt"]
- name: gcr.io/cloud-builders/git
args: [ "config", "--global", "user.name", "batman" ]
- name: gcr.io/cloud-builders/git
args: [ "config", "--global", "user.email", "batman@gotham.city" ]
- name: gcr.io/cloud-builders/git
args: [ "add", "-A" ]
- name: gcr.io/cloud-builders/git
args: [ 'commit', '-m', 'batmans commit' ]
- name: gcr.io/cloud-builders/git
args: [ 'push', 'https://source.developers.google.com/p/$PROJECT_ID/r/my-repo', 'master']