Cloud Build と Github連携
Cloud Buildを初めて使いました。
Laravelをデプロイするときの個人的なcloudbuid.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
| steps:
- name: node entrypoint: npm args: ['install'] - name: node entrypoint: npm args: ['run', 'production']
- name: gcr.io/cloud-builders/gcloud entrypoint: 'bash' args: [ '-c', "gcloud secrets versions access latest --secret=xxxxxx --format='get(payload.data)' | tr '_-' '/+' | base64 -d > secret.yaml" ]
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' entrypoint: 'bash' args: ['-c', 'gcloud config set app/cloud_build_timeout 1600 && gcloud app deploy app.yaml --project=xxxxxx']
- name: gcr.io/cloud-builders/curl args: - -X - POST - --data-urlencode - "payload={\"text\":\"$BUILD_ID $REPO_NAMEをデプロイしました\"}" - https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxxxxxxx
timeout: '1600s'
|