forked from aantron/better-enums
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild.yaml
41 lines (38 loc) · 1.27 KB
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# In this directory, run the following command to build this builder.
# $ gcloud builds submit . --config=cloudbuild.yaml
steps:
- id: 'Inject GitHub credentials'
name: gcr.io/cloud-builders/gcloud
entrypoint: 'bash'
args: [ '-c', 'gcloud secrets versions access latest --secret=miso-deploy-ssh-key > /root/.ssh/id_github' ]
volumes:
- name: 'ssh'
path: /root/.ssh
- id: 'Set up git repository'
name: gcr.io/cloud-builders/git
entrypoint: 'bash'
args:
- '-c'
- |
chmod 600 /root/.ssh/id_github
cat <<EOF >/root/.ssh/config
Hostname github.com
IdentityFile /root/.ssh/id_github
EOF
ssh-keyscan -t rsa github.com > /root/.ssh/known_hosts
git remote set-url origin git@github.com:MisoRobotics/$REPO_NAME.git
git fetch origin $_BASE_BRANCH:refs/remotes/origin/$_BASE_BRANCH
volumes:
- name: 'ssh'
path: /root/.ssh
- id: 'Run gitlint'
name: gcr.io/software-builds/miso-cloud-builders/gitlint
args:
- '--commits'
- 'origin/$_BASE_BRANCH..$COMMIT_SHA'
- '-c'
- 'general.ignore-fixup-commits=false'
- '-c'
- 'general.ignore-squash-commits=false'
- '-c'
- 'title-must-not-contain-word.words=WIP,FIXUP,SQUASH'