-
Notifications
You must be signed in to change notification settings - Fork 6
/
cloudbuild-auth-old.yml
50 lines (50 loc) · 1.89 KB
/
cloudbuild-auth-old.yml
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
steps:
# Build the container image
- name: 'buildpacksio/pack'
entrypoint: 'pack'
args:
- build
- gcr.io/$PROJECT_ID/oos-auth:$SHORT_SHA
- --cache-image=gcr.io/$PROJECT_ID/oos-cache:auth
- --buildpack=gcr.io/paketo-buildpacks/dotnet-core
- --buildpack=gcr.io/paketo-buildpacks/environment-variables
- --builder=paketobuildpacks/builder-jammy-base:latest
- --env=BP_DOTNET_PROJECT_PATH=./OutOfSchool/OutOfSchool.IdentityServer/
- --env=BPE_AppDefaults__Version=$SHORT_SHA
- --publish
# Deploy container image to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args:
- beta
- run
- deploy
- authservice
- --image
- gcr.io/$PROJECT_ID/oos-auth:$SHORT_SHA
- --region
- $_REGION
- --platform
- managed
- --ingress
- internal-and-cloud-load-balancing
- --allow-unauthenticated
- --service-account
- $_SERVICE_ACCOUNT
- --cpu=2
- --memory=512Mi
- --max-instances=3
- --concurrency=120
- --set-env-vars=ASPNETCORE_ENVIRONMENT=$_ASPNETCORE_ENVIRONMENT
- --set-env-vars=Email__AddressFrom=$_SENDER_EMAIL
- --set-env-vars=ConnectionStringsOverride__DefaultConnection__UserId=oos
- --set-env-vars=ConnectionStringsOverride__DefaultConnection__Port=$_SQL_PORT
- --set-env-vars=AppDefaults__Version=$SHORT_SHA
- --set-secrets=ConnectionStringsOverride__DefaultConnection__Password=$_DB_PASS,Email__SendGridKey=$_SENDGRID_KEY
# Disable http2 because prod will be http1.1 for now
- --no-use-http2
# Clean old versions except previous Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: bash
args:
- -c
- for revision in `gcloud run revisions list --service authservice --platform managed --region $_REGION --format 'value(name)' | sort -r | tail -n +3 | paste -sd " " -`; do $(yes | gcloud run revisions delete --platform managed --region $_REGION $revision) || exit 0; done;