Skip to content

Configuration Page

Leonardo Espinosa Torres edited this page Oct 11, 2017 · 4 revisions

Testing Deploy

Execute following steps to prepare Iurest project in Testing Environment:

References: https://cloud.google.com/container-engine/docs/tutorials/hello-app

  • Install Qrios with no optional dependencies
npm install --save --no-optional qrious
  • Create NodeJs project from meteor project -> Branch tsti4t
meteor build ../../../deploy-tsti4t/ --directory --server-only --architecture os.linux.x86_64
  • Export environment variables to deploy
export MONGO_URL="mongodb://leonardoespinosa: [email protected]:27017,tstiurest-shard-00-01-pgydc.gcp.mongodb.net:27017,tstiurest-shard-00-02-pgydc.gcp.mongodb.net:27017/test?ssl=true&replicaSet=tstiurest-shard-0&authSource=admin"
export ROOT_URL="http://localhost"
export MAIL_URL="smtp://postmaster%40sandbox95e176686a5c4d7a9e057c9b830aa52b.mailgun.org:[email protected]:587"
export PORT="8080"
  • Delete attribute in dir programs/server/package.json on NodeJs project
"scripts": {
    "install": "node npm-rebuild.js"
  }

The next steps allow create Docker Container and push in GCloud

  • Build docker image
docker build -t tsti4t .
  • list docker images
docker images
  • Test docker image
docker run -p 8080:8080 tsti4t
  • Create Tag to docker image (Specific version)
docker tag tsti4t gcr.io/pr-tsti4t/tsti4t:<v0.0.0>
docker tag tsti4t gcr.io/pr-tsti4t/tsti4t:v1.0.0
  • Push docker image in GCloud. Execute gcloud init first and docker login!
gcloud docker -- push gcr.io/pr-tsti4t/tsti4t:<v0.0.0>
gcloud docker -- push gcr.io/pr-tsti4t/tsti4t:v1.0.0
  • Set Zone in GCloud
gcloud config set compute/zone us-east1-d
  • List container clusters
gcloud container clusters list
  • List docker image tags in GCloud
gcloud container images list-tags gcr.io/pr-tsti4t/tsti4t
  • Get cluster credentials
gcloud container clusters get-credentials cl-tsti4t
  • Update Deployment
kubectl set image deployment/tsti4t-node tsti4t-node=gcr.io/pr-tsti4t/tsti4t:<v0.0.0>