-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Salva Corts
committed
Mar 14, 2018
1 parent
e4bf633
commit 13bb977
Showing
4 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
## Note: credentials files are created from env variables created with: | ||
## base64 <credentials-file-example.json> | ||
|
||
# Remove env vars | ||
set -e | ||
|
||
# Configure Google Cloud SDK | ||
echo $GCLOUD_SERVICE_KEY_STG | base64 --decode -i > ${HOME}/Backend/creds.json | ||
gcloud auth activate-service-account --key-file ${HOME}/Backend/creds.json | ||
gcloud --quiet config set project $PROJECT_NAME | ||
gcloud --quiet config set compute/zone $CLOUDSDK_COMPUTE_ZONE | ||
|
||
|
||
# Build Backend | ||
cd Backend/ | ||
docker build -f dockerfile -t gcr.io/how-it-does/backend:latest . | ||
gcloud docker -- push gcr.io/how-it-does/backend:latest | ||
kubectl rolling-update backend --image=gcr.io/how-it-does/backend:latest | ||
|
||
# Move from backent to Frontend | ||
cd ../Frontend/ | ||
docker build -f dockerfile -t gcr.io/how-it-does/frontend:latest . | ||
gcloud docker -- push gcr.io/how-it-does/frontend:latest | ||
kubectl rolling-update frontend --image=gcr.io/how-it-does/frontend:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# REF: https://medium.com/google-cloud/continuous-delivery-in-a-microservice-infrastructure-with-google-container-engine-docker-and-fb9772e81da7 | ||
sudo: false | ||
|
||
language: golang # Unimportant | ||
|
||
# Cache Gcloud SDK between commands | ||
cache: | ||
directories: | ||
- "$HOME/google-cloud-sdk/" | ||
|
||
services: | ||
- docker | ||
|
||
# Install gcloud sdk if it doesnt exists | ||
before_deploy: | ||
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; export CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl https://sdk.cloud.google.com | bash; fi | ||
- source /home/travis/google-cloud-sdk/path.bash.inc | ||
- gcloud --quiet version | ||
- gcloud --quiet components update | ||
- gcloud --quiet components beta update | ||
- gcloud --quiet components update kubectl | ||
|
||
deploy: | ||
- provider: script | ||
script: ./build-and-deploy.sh | ||
skip_cleanup: true | ||
on: | ||
branch: master |