-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from nikhilrayaprolu/travisfinal
Fixes #15 deploys master branch to google cloud
- Loading branch information
Showing
6 changed files
with
86 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
sudo: required | ||
# Use node_js environnement | ||
language: java | ||
|
||
# Cache Gcloud SDK between commands | ||
|
||
cache: | ||
directories: | ||
- "$HOME/google-cloud-sdk/" | ||
|
||
# Install services | ||
services: | ||
- docker | ||
|
||
# Set env vars | ||
env: | ||
global: | ||
- GOOGLE_APPLICATION_CREDENTIALS=~/gcloud-service-key.json | ||
- PROJECT_NAME_STG=yacygrid | ||
- CLUSTER_NAME_STG=cluster-1 | ||
- CLOUDSDK_COMPUTE_ZONE=us-central1-a | ||
- DOCKER_IMAGE_NAME=yacygridmcp | ||
- KUBE_DEPLOYMENT_NAME=yacygridmcp | ||
- KUBE_DEPLOYMENT_CONTAINER_NAME=yacygridmcp | ||
- NODE_ENV=CI | ||
|
||
|
||
script: | ||
- 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 update kubectl | ||
- bash ./deploy_staging.sh | ||
|
||
branches: | ||
only: | ||
- master |
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,16 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: yacygridmcp | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: yacygridmcp | ||
spec: | ||
containers: | ||
- name: yacygridmcp | ||
image: gcr.io/yacygrid/yacygridmcp | ||
ports: | ||
- containerPort: 8080 |
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,24 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
docker build -t nikhilrayaprolu/yacygridmcp:$TRAVIS_COMMIT ./docker | ||
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" | ||
docker push nikhilrayaprolu/yacygridmcp | ||
echo $GCLOUD_SERVICE | base64 --decode -i > ${HOME}/gcloud-service-key.json | ||
cat ${HOME}/gcloud-service-key.json | ||
gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json | ||
|
||
gcloud --quiet config set project $PROJECT_NAME_STG | ||
gcloud --quiet config set container/cluster $CLUSTER_NAME_STG | ||
gcloud --quiet config set compute/zone ${CLOUDSDK_COMPUTE_ZONE} | ||
gcloud --quiet container clusters get-credentials $CLUSTER_NAME_STG | ||
|
||
|
||
kubectl config view | ||
kubectl config current-context | ||
|
||
kubectl set image deployment/${KUBE_DEPLOYMENT_NAME} ${KUBE_DEPLOYMENT_CONTAINER_NAME}=nikhilrayaprolu/yacygridmcp:$TRAVIS_COMMIT | ||
|
||
# sleep 30 | ||
# npm run e2e_test |
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
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