-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
49 lines (41 loc) · 1.75 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
42
43
44
45
46
47
48
49
steps:
- id: 'Decrypting credentials'
name: 'gcr.io/cloud-builders/gcloud'
args:
- kms
- decrypt
- --ciphertext-file=./backend/storage/credentials/gcp/service-account.json.enc
- --plaintext-file=./backend/storage/credentials/gcp/service-account.json
- --location=global
- --keyring=micro-videos
- --key=service-account
- id: 'Running docker-compose'
name: 'gcr.io/$PROJECT_ID/docker-compose'
args: ['-f','docker-compose.prod.yaml', 'up', '-d']
env:
- GOOGLE_CLOUD_PROJECT_ID=$PROJECT_ID
- GOOGLE_CLOUD_KEY_FILE=service-account.json
- GOOGLE_CLOUD_STORAGE_BUCKET=code-micro-videos-bucket
- GOOGLE_CLOUD_STORAGE_API_URI=https://storage.cloud.google.com/code-micro-videos-bucket
- TESTING_PROD=true
- id: "Chown in /var/www"
name: 'gcr.io/cloud-builders/docker'
args: ['exec','-u','root','-t','app','chown','-R','www-data:www-data','/var/www']
- id: 'Running composer'
name: 'gcr.io/cloud-builders/docker'
args: ['exec','-t','app','composer','install']
- id: 'Copying .env'
name: 'gcr.io/cloud-builders/docker'
args: ['exec', '-t', 'app', 'cp', '.env.example','.env']
- id: 'Copying .env.testing'
name: 'gcr.io/cloud-builders/docker'
args: ['exec', '-t', 'app', 'cp', '.env.testing.example','.env.testing']
- id: 'Running key:generate'
name: 'gcr.io/cloud-builders/docker'
args: [ 'exec','-t','app','php','/var/www/artisan','key:generate']
- id: 'Running migrations'
name: 'gcr.io/cloud-builders/docker'
args: [ 'exec','-t','app','php','/var/www/artisan','migrate']
- id: 'Running PhpUnit'
name: 'gcr.io/cloud-builders/docker'
args: [ 'exec','-t','app','php','/var/www/vendor/bin/phpunit','-c','/var/www/phpunit.xml']