-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudbuild.prod.yaml
83 lines (62 loc) · 2.62 KB
/
cloudbuild.prod.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
steps:
- id: 'Rodando docker-compose'
name: 'gcr.io/$PROJECT_ID/docker-compose'
args: ['-f','docker-compose.cloudbuild.yml','up','-d']
- id: 'Rodando docker ps'
name: 'gcr.io/cloud-builders/docker'
args: ['ps']
- id: 'Rodando compose'
name: 'gcr.io/cloud-builders/docker'
args: ['exec','-t','app', 'composer', 'install']
- id: 'Copiando .env'
name: 'gcr.io/cloud-builders/docker'
args: ['exec','-t','app', 'cp', '.env.example', '.env']
- id: 'Rodando key:generate'
name: 'gcr.io/cloud-builders/docker'
args: ['exec','-t','app', 'php', '/var/www/artisan', 'key:generate']
- id: 'Rodando Phpunit'
name: 'gcr.io/cloud-builders/docker'
args: ['exec','-t','app', 'php', '/var/www/vendor/bin/phpunit', '-c', '/var/www/phpunit.xml']
- id: "Building image from Dockerfile.prod"
name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/app-laravel:$SHORT_SHA', '-f', 'Dockerfile.prod', '.']
- id: "Pushing image APP"
name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/app-laravel:$SHORT_SHA']
- id: "Adjustin deployment app file - k8s"
name: 'gcr.io/cloud-builders/gcloud'
entrypoint: '/bin/sh'
args:
- '-c'
- |
sed 's#img-app-deployment#gcr.io/$PROJECT_ID/app-laravel:$SHORT_SHA#g' k8s/app/deployment.yaml > k8s/app/deployment-new.yaml;
- id: "Deployment APP"
name: 'gcr.io/cloud-builders/kubectl'
args: ['apply', '-f', 'k8s/app/deployment-new.yaml'] #deployment-new.yaml
env:
- 'CLOUDSDK_COMPUTE_ZONE=southamerica-east1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=cluster-sirflor-mapas'
- id: "Service APP"
name: 'gcr.io/cloud-builders/kubectl'
args: ['apply', '-f', 'k8s/app/service.yaml']
env:
- 'CLOUDSDK_COMPUTE_ZONE=southamerica-east1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=cluster-sirflor-mapas'
- id: "Deployment Mysql"
name: 'gcr.io/cloud-builders/kubectl'
args: ['apply', '-f', 'k8s/mysql/'] #deployment-new.yaml
env:
- 'CLOUDSDK_COMPUTE_ZONE=southamerica-east1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=cluster-sirflor-mapas'
- id: "Deployment Nginx"
name: 'gcr.io/cloud-builders/kubectl'
args: ['apply', '-f', 'k8s/nginx/'] #deployment-new.yaml
env:
- 'CLOUDSDK_COMPUTE_ZONE=southamerica-east1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=cluster-sirflor-mapas'
- id: "Deployment Redis"
name: 'gcr.io/cloud-builders/kubectl'
args: ['apply', '-f', 'k8s/redis/'] #deployment-new.yaml
env:
- 'CLOUDSDK_COMPUTE_ZONE=southamerica-east1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=cluster-sirflor-mapas'