Skip to content

Commit

Permalink
Parameterised GCP_PROJECT_ID in k8s yaml files
Browse files Browse the repository at this point in the history
  • Loading branch information
vihangpatil committed Feb 18, 2019
1 parent fb0c723 commit 0a92c4a
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bq-metrics-extractor/cronjob/deploy-dev-direct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ docker push eu.gcr.io/${GCP_PROJECT_ID}/bq-metrics-extractor:${TAG}

echo "Deploying bq-metrics-extractor to GKE"

sed -e 's/EXTRACTOR_VERSION/${TAG}/g; s/GCP_PROJECT_ID/${GCP_PROJECT_ID}/g' bq-metrics-extractor/cronjob/extractor-dev.yaml | kubectl apply -f -
sed -e 's/EXTRACTOR_VERSION/'"${TAG}"'/g; s/GCP_PROJECT_ID/'"${GCP_PROJECT_ID}"'/g' bq-metrics-extractor/cronjob/extractor-dev.yaml | kubectl apply -f -
2 changes: 1 addition & 1 deletion bq-metrics-extractor/cronjob/deploy-direct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ docker push eu.gcr.io/${GCP_PROJECT_ID}/bq-metrics-extractor:${TAG}

echo "Deploying bq-metrics-extractor to GKE"

sed -e 's/EXTRACTOR_VERSION/${TAG}/g; s/GCP_PROJECT_ID/${GCP_PROJECT_ID}/g' bq-metrics-extractor/cronjob/extractor.yaml | kubectl apply -f -
sed -e 's/EXTRACTOR_VERSION/'"${TAG}"'/g; s/GCP_PROJECT_ID/'"${GCP_PROJECT_ID}"'/g' bq-metrics-extractor/cronjob/extractor.yaml | kubectl apply -f -
2 changes: 1 addition & 1 deletion exporter/deploy/deploy-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ docker push eu.gcr.io/${GCP_PROJECT_ID}/exporter:${TAG}

echo "Deploying exporter to GKE"

sed -e 's/EXPORTER_VERSION/${TAG}/g; s/GCP_PROJECT_ID/${GCP_PROJECT_ID}/g' exporter/deploy/exporter-dev.yaml | kubectl apply -f -
sed -e 's/EXPORTER_VERSION/'"${TAG}"'/g; s/_GCP_PROJECT_ID/'"${GCP_PROJECT_ID}"'/g' exporter/deploy/exporter-dev.yaml | kubectl apply -f -
2 changes: 1 addition & 1 deletion exporter/deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ docker push eu.gcr.io/${GCP_PROJECT_ID}/exporter:${TAG}

echo "Deploying exporter to GKE"

sed -e 's/EXPORTER_VERSION/${TAG}/g; s/GCP_PROJECT_ID/${GCP_PROJECT_ID}/g' exporter/deploy/exporter.yaml | kubectl apply -f -
sed -e 's/EXPORTER_VERSION/'"${TAG}"'/g; s/_GCP_PROJECT_ID/'"${GCP_PROJECT_ID}"'/g' exporter/deploy/exporter.yaml | kubectl apply -f -


GCP_PROJECT_ID
4 changes: 2 additions & 2 deletions exporter/deploy/exporter-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ spec:
spec:
containers:
- name: exporter
image: eu.gcr.io/GCP_PROJECT_ID/exporter:EXPORTER_VERSION
image: eu.gcr.io/_GCP_PROJECT_ID/exporter:EXPORTER_VERSION
imagePullPolicy: Always
env:
- name: GCP_PROJECT_ID
value: GCP_PROJECT_ID
value: _GCP_PROJECT_ID
- name: DATASET_MODIFIER
value: _dev
ports:
Expand Down
4 changes: 2 additions & 2 deletions exporter/deploy/exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ spec:
spec:
containers:
- name: exporter
image: eu.gcr.io/GCP_PROJECT_ID/exporter:EXPORTER_VERSION
image: eu.gcr.io/_GCP_PROJECT_ID/exporter:EXPORTER_VERSION
imagePullPolicy: Always
env:
- name: GCP_PROJECT_ID
value: GCP_PROJECT_ID
value: _GCP_PROJECT_ID
ports:
- containerPort: 8080
2 changes: 1 addition & 1 deletion prime/infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Update the tag (version) of prime's docker image in `infra/prod/prime.yaml`.
Apply the deployment & service

```bash
sed -e 's/PRIME_VERSION/${PRIME_VERSION}/g; s/GCP_PROJECT_ID/${GCP_PROJECT_ID}/g' prime/infra/prod/prime.yaml | kubectl apply -f -
sed -e 's/PRIME_VERSION/${PRIME_VERSION}/g; s/_GCP_PROJECT_ID/'"${GCP_PROJECT_ID}"'/g' prime/infra/prod/prime.yaml | kubectl apply -f -
```

Details of the deployment
Expand Down
4 changes: 3 additions & 1 deletion prime/infra/dev/prime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ spec:
name: api-ostelco-ssl
readOnly: true
- name: prime
image: eu.gcr.io/GCP_PROJECT_ID/prime:PRIME_VERSION
image: eu.gcr.io/_GCP_PROJECT_ID/prime:PRIME_VERSION
imagePullPolicy: Always
env:
- name: SLACK_CHANNEL
Expand Down Expand Up @@ -279,6 +279,8 @@ spec:
key: apiSecret
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/pantel-prod.json
- name: GCP_PROJECT_ID
value: _GCP_PROJECT_ID
volumeMounts:
- name: secret-config
mountPath: "/secret"
Expand Down
4 changes: 3 additions & 1 deletion prime/infra/prod/prime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ spec:
name: metrics-ostelco-ssl
readOnly: true
- name: prime
image: eu.gcr.io/GCP_PROJECT_ID/prime:PRIME_VERSION
image: eu.gcr.io/_GCP_PROJECT_ID/prime:PRIME_VERSION
imagePullPolicy: Always
env:
- name: SLACK_CHANNEL
Expand All @@ -178,6 +178,8 @@ spec:
secretKeyRef:
name: stripe-secrets
key: stripeApiKey
- name: GCP_PROJECT_ID
value: _GCP_PROJECT_ID
volumeMounts:
- name: secret-config
mountPath: "/secret"
Expand Down
2 changes: 1 addition & 1 deletion prime/script/deploy-dev-direct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ docker push eu.gcr.io/${GCP_PROJECT_ID}/prime:${TAG}

echo "Deploying prime to GKE"

sed -e 's/PRIME_VERSION/${TAG}/g; s/GCP_PROJECT_ID/${GCP_PROJECT_ID}/g' prime/infra/dev/prime.yaml | kubectl apply -f -
sed -e 's/PRIME_VERSION/'"${TAG}"'/g; s/_GCP_PROJECT_ID/'"${GCP_PROJECT_ID}"'/g' prime/infra/dev/prime.yaml | kubectl apply -f -
2 changes: 1 addition & 1 deletion prime/script/deploy-direct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ docker push eu.gcr.io/${GCP_PROJECT_ID}/prime:${TAG}

echo "Deploying prime to GKE"

sed -e 's/PRIME_VERSION/${TAG}/g; s/GCP_PROJECT_ID/${GCP_PROJECT_ID}/g' prime/infra/prod/prime.yaml | kubectl apply -f -
sed -e 's/PRIME_VERSION/'"${TAG}"'/g; s/_GCP_PROJECT_ID/'"${GCP_PROJECT_ID}"'/g' prime/infra/prod/prime.yaml | kubectl apply -f -
2 changes: 1 addition & 1 deletion scaninfo-shredder/cronjob/deploy-dev-direct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ docker push eu.gcr.io/${GCP_PROJECT_ID}/scaninfo-shredder:${TAG}

echo "Deploying scaninfo-shredder to GKE"

sed -e 's/SHREDDER_VERSION/${TAG}/g; s/GCP_PROJECT_ID/${GCP_PROJECT_ID}/g' scaninfo-shredder/cronjob/shredder-dev.yaml | kubectl apply -f -
sed -e 's/SHREDDER_VERSION/'"${TAG}"'/g; s/GCP_PROJECT_ID/'"${GCP_PROJECT_ID}"'/g' scaninfo-shredder/cronjob/shredder-dev.yaml | kubectl apply -f -
2 changes: 1 addition & 1 deletion scaninfo-shredder/cronjob/deploy-direct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ docker push eu.gcr.io/${GCP_PROJECT_ID}/scaninfo-shredder:${TAG}

echo "Deploying scaninfo-shredder to GKE"

sed -e 's/SHREDDER_VERSION/${TAG}/g; s/GCP_PROJECT_ID/${GCP_PROJECT_ID}/g' scaninfo-shredder/cronjob/shredder.yaml | kubectl apply -f -
sed -e 's/SHREDDER_VERSION/'"${TAG}"'/g; s/GCP_PROJECT_ID/'"${GCP_PROJECT_ID}"'/g' scaninfo-shredder/cronjob/shredder.yaml | kubectl apply -f -
2 changes: 1 addition & 1 deletion sim-administration/simmanager/deploy-to-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ docker push eu.gcr.io/${GCP_PROJECT_ID}/simmanager:${TAG}

echo "Deploying eu.gcr.io/${GCP_PROJECT_ID}/simmanager:${TAG} to GKE"

sed -e 's/SIMMANAGER_VERSION/${TAG}/g; s/GCP_PROJECT_ID/${GCP_PROJECT_ID}/g' simmanager-deploy.yaml | kubectl apply -f -
sed -e 's/SIMMANAGER_VERSION/'"${TAG}"'/g; s/GCP_PROJECT_ID/'"${GCP_PROJECT_ID}"'/g' simmanager-deploy.yaml | kubectl apply -f -

0 comments on commit 0a92c4a

Please sign in to comment.