pull/124/head
Frostebite 2020-07-23 23:50:23 +01:00
parent ff1333fe05
commit 5d89e3bb93
3 changed files with 11 additions and 2 deletions

View File

@ -9,7 +9,7 @@ env:
GKE_ZONE: 'us-central1-c'
GKE_REGION: 'us-central1'
GKE_PROJECT: 'unitykubernetesbuilder'
GKE_CLUSTER: 'cluster-1'
GKE_CLUSTER: 'unity-builder-cluster'
jobs:
tests:
@ -101,6 +101,8 @@ jobs:
service_account_key: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
- id: read-k8s-config
run: |
downloadCluster=$(gcloud container clusters list --project $GKE_PROJECT --format="json" | jq '.[] | select(.name == "${{env.GKE_CLUSTER}}")')
[ -z "$downloadCluster" ] && gcloud components install beta && gcloud beta container --project "unitykubernetesbuilder" clusters create ${{env.GKE_CLUSTER}} --zone "us-central1-c" --no-enable-basic-auth --cluster-version "1.14.10-gke.36" --machine-type "custom-1-2048" --image-type "COS" --disk-type "pd-standard" --disk-size "25" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" --num-nodes "1" --enable-stackdriver-kubernetes --enable-ip-alias --network "projects/unitykubernetesbuilder/global/networks/default" --subnetwork "projects/unitykubernetesbuilder/regions/us-central1/subnetworks/default" --default-max-pods-per-node "110" --no-enable-master-authorized-networks --addons HorizontalPodAutoscaling,HttpLoadBalancing --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0
gcloud container clusters get-credentials $GKE_CLUSTER \
--zone $GKE_ZONE --project $GKE_PROJECT
# run a command to get access-token
@ -127,3 +129,7 @@ jobs:
with:
name: Kubernetes Build (${{ matrix.targetPlatform }})
path: k8s-volume-download
- run: |
pods=$(kubectl get pods -o json | jq '.items | .[].metadata.labels' | jq 'select("app", "unity-builder")')
[ -z pods ] || gcloud container clusters delete ${{env.GKE_CLUSTER}} --zone $GKE_ZONE --project $GKE_PROJECT --quiet
if: ${{ always() }}

File diff suppressed because one or more lines are too long

View File

@ -100,6 +100,9 @@ class Kubernetes {
kind: 'Job',
metadata: {
name: this.jobName,
labels: {
app: 'unity-builder',
},
},
spec: {
template: {