Skip to content
Leonardo Espinosa Torres edited this page Apr 22, 2018 · 4 revisions

Testing Deploy

Execute following steps to prepare comeygana project in Testing Environment:

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

  • Create NodeJs project from meteor project
meteor build ../../deploy-tstcyg/ --directory --server-only --architecture os.linux.x86_64
  • Export environment variables to deploy
export MONGO_URL="mongodb://leonardoespinosa: Leonardo2503@tstiurest-shard-00-00-pgydc.gcp.mongodb.net: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:9e00683bdf7a01bc8061e7d28be6afd5@smtp.mailgun.org:587"
export PORT="8080"

The next steps allow create Docker Container and push in GCloud

  • Build docker image
docker build -t tstcyg .
  • list docker images
docker images
  • Test docker image
docker run -p 8080:8080 tstcyg
  • Create Tag to docker image (Specific version)
docker tag tstcyg gcr.io/comeygana-201900/tstcyg:<v0.0.0>
docker tag tstcyg gcr.io/comeygana-201900/tstcyg:v1.0.0
  • Push docker image in GCloud. Execute gcloud init first and docker login!
gcloud docker -- push gcr.io/comeygana-201900/tstcyg:<v0.0.0>
gcloud docker -- push gcr.io/comeygana-201900/tstcyg: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/comeygana-201900/tstcyg
  • Get cluster credentials
gcloud container clusters get-credentials cl-cyg-tst
  • Update Deployment
kubectl set image deployment/tstcyg-node tstcyg-node=gcr.io/comeygana-201900/tstcyg:<v0.0.0>
Clone this wiki locally