Skip to content
keita-koga edited this page Jun 17, 2018 · 2 revisions

Encrypt environment variables with Travis CI

step 1

gem install travis --no-rdoc --no-ri

step 2

We will use travis encrypt.

In the example below, two variables PHP_JSON_LOGGER_SLACK_TOKEN and PHP_JSON_LOGGER_SLACK_CHANNEL are encrypted.

travis encrypt PHP_JSON_LOGGER_SLACK_TOKEN=SecretToken PHP_JSON_LOGGER_SLACK_CHANNEL=#test-channel

step 3

Write to .travis.yml.

env:
  global:
    secure: "Write the result of `travis encrypt`."

links

Clone this wiki locally