Working with credentials files - Gapminder/dollar-street-framework GitHub Wiki

Credentials files sample:

File name format - XXX.YYY.json where XXX - is your NODE_ENV, YYY - is your MODE_ENV. (local.ds.json, dev.ds.json, etc.)

{
   "MONGODB_URL": "XXXXXXXXXX",

  "CMS_EXTERNAL_PORT": "XXXXXXXXXX",
  "CMS_SOCKETS_PORT": "XXXXXXXXXX",
  "CMS_SERVER_VERSION": "XXXXXXXXXX",
  "CMS_APPROVE_MAIL": "XXXXXXXXXX",
  "CMS_APPROVE_PASSWORD": "XXXXXXXXXX",

  "CROWDIN_API_KEY": "XXXXXXXXXX",
  "CROWDIN_PROJECT_NAME": "XXXXXXXXXX",

  "S3_PROTOCOL": "XXXXXXXXXX",
  "S3_BUCKET": "XXXXXXXXXX",
  "S3_SERVER_PREFIX": "XXXXXXXXXX",
  "S3_REGION": "XXXXXXXXXX",
  "S3_ACCESS_KEY_ID": "XXXXXXXXXX",
  "S3_SECRET_ACCESS_KEY": "XXXXXXXXXX",
  "S3_EMBED_VERSION": "XXXXXXXXXX",

  "DEV": "XXXXXXXXXX",
  "BASE_HREF": "XXXXXXXXXX",
  "EXTERNAL_PORT": "XXXXXXXXXX",
  "MODE_ENV": "XXXXXXXXXX",
  "API_URL": "XXXXXXXXXX",

  "DEFAULT_STATE": {
    "THING_ICON": "XXXXXXXXXX",
    "THING_NAME": "XXXXXXXXXX",
    "THING_HOME": "XXXXXXXXXX",
    "PLACE_TYPE_INIT": "XXXXXXXXXX",
    "FORM_NAME_V3": "XXXXXXXXXX",
    "FORM_NAME_V2": "XXXXXXXXXX",
    "FORM_NAME_V1": "XXXXXXXXXX",
    "QUESTIONS_THING_NAME": "XXXXXXXXXX",
    "QUESTIONS_THING_FIRST_NAME": "XXXXXXXXXX",
    "FILTER": "XXXXXXXXXX",
    "PLACE_TYPE": "XXXXXXXXXX",
    "FORM": "XXXXXXXXXX"
  },

  "STRIPE_PRIVATE_KEY": "XXXXXXXXXX",
  "STRIPE_PUBLIC_KEY": "XXXXXXXXXX",

  "CLUSTER_PUPPETEER_EXTERNAL_IP": "XXXXXXXXXX",[if Puppeteer used]
  "CLUSTER_PUPPETEER_EXTERNAL_PORT": "XXXXXXXXXX",[if Puppeteer used]
  "CLUSTER_SPLASH_INTERNAL_IP": "XXXXXXXXXX",[if Splash used]
  "CLUSTER_SPLASH_EXTERNAL_IP": "XXXXXXXXXX",[if Splash used]
  "INSTANCE_SPLASH_PORT": "XXXXXXXXXX",[if Splash used]
  "PATH_TO_DOWNLOAD_IMAGES": "XXXXXXXXXX",
  "FLAG_BUILD_ANGULAR_PRODUCTION": "XXXXXXXXXX",

  "SHARE_EMBED_DESCRIPTION": "XXXXXXXXXX",
  "SHARE_EMBED_TITLE": "XXXXXXXXXX"
}

All credentials file stored in the envs.tar.enc file - encrypted for usage on Travis CI.

If you need to update any of env file you need to have Travis CLI installed on your local.

To install Travis CLI:

Make sure you have at least Ruby 1.9.3 (2.0.0 recommended) installed.

You can check your Ruby version by running ruby -v:

$ ruby -v
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]

Make sure you have every needed package

sudo apt-get install ruby`ruby -e 'puts RUBY_VERSION[/\d+\.\d+/]'`-dev

Then run:

$ gem install travis -v 1.8.9 --no-rdoc --no-ri

Now make sure everything is working:

$ travis version
1.8.9

Please check the issue below for troubleshooting possible problems. (known issues https://github.com/travis-ci/travis.rb/issues/391);

After you install the Travis CLI you need to login in it with your GitHub account which has access to the repository you work with.

$ travis login --org
Username: `your GitHub account`
Password: `your GitHub password` 

Update the file.

In case you change any existed XXX.YYY.json and want to use it during deployment, run

npm run update:travis-envs

Сommit and push new envs.tar.enc and encrypted changes Travis .yml.

Setting up Travis CI see in another page