Skip to content

RomansBermans/google-cloud-node-cluster

Repository files navigation

google-cloud-node-cluster Build Status

Run a Node.js Cluster on Google Cloud Platform.

Setup

Google Cloud Platform

  1. Install Google Cloud SDK
  2. Create a project on Google Cloud Platform and note down the Project ID
  3. If using Travis CI:
    1. Create an account on Travis CI and activate your repository
    2. Enable Google Cloud Platform > App Engine Admin API
    3. Create a service account on Google Cloud Platform > IAM with Project > Editor role and download the JSON private key
    4. Rename the downloaded private key to travis.server.prod.key.json and save it in the environment/private folder
    5. gem install travis
    6. travis login
    7. tar cvf environment/private.tar -C environment/private . && travis encrypt-file environment/private.tar environment/private.tar.enc -f && rm -f environment/private.tar

Install

npm install

Start

npm start

Develop

npm run develop

Test

npm test

Deploy

Command Line

Replace GOOGLE-CLOUD-PLATFORM-PROJECT-ID with your Project ID and execute:

export ENVIRONMENT=prod && export PROJECT=GOOGLE-CLOUD-PLATFORM-PROJECT-ID && export VERSION=$(node -p -e "require('./package').version") && export VERSION=${VERSION//[^[:alnum:]^-]} && npm run deploy

Travis CI

Add [deploy] to you git commit message.