Update : Travis now supports defining variables directly in storage assemblies through its web user interface. So, if you donβt need to generate local encrypted variables manually for your .travis.yml file (according to the original answer below), this seems like the easiest way to get the environment variable working with Travis CI.
I'm not sure about the specifics of Node.js, but if you want to use QINIU_ACCESS_KEY and QINIU_SECRET_KEY in .travis.yml , not being plain text, make them protected environment variables :
Step 0: install the travis gem ( install Rubygems , if you do not already have it, I'm not sure if there is another way to get the travis command or another way to perform step 1 below):
$ gem install travis
Step 1: Encrypt the values, taking note of the result:
$ travis encrypt QINIU_ACCESS_KEY=2FRuiVGEsA511NS9pNd2uvuSB3k5ozXE_DHCH8Ov $ travis encrypt QINIU_SECRET_KEY=CIRtcmymB3VeIfXebFvYxmMmH9u2oLKW6rffVvoK
Step 2. Add values ββto the .travis.yml file:
env: global: - secure: {{ENCRYPTED_QINIU_ACCESS_KEY}} - secure: {{ENCRYPTED_QINIU_SECRET_KEY}}
(A few keys called secure not a problem)
The next time your application goes through Travis, you should see the Config line:
Env: QINIU_ACCESS_KEY = [secure] QINIU_SECRET_KEY = [secure]
More StackOverflow Q & as it may be useful (this is in the context of Ruby on Rails, but they deal with this problem):
source share