September 2018
Intermediate to advanced
764 pages
20h 6m
English
Lastly, our application reads variables from the environment. Since the .env and test.env files are not included as part of our repository, we need to manually provide them to Travis. We can do this by adding an env.global block:
env: global: - NODE_ENV=test - SERVER_PROTOCOL=http - SERVER_HOSTNAME=localhost - SERVER_PORT=8888 - ELASTICSEARCH_PROTOCOL=http - ELASTICSEARCH_HOSTNAME=localhost - ELASTICSEARCH_PORT=9200 - ELASTICSEARCH_INDEX=test
Our final .travis.yml should look like this:
language: node_jsnode_js: - "node" - "lts/*" - "8" - "8.11.4"services: - elasticsearchbefore_install: - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.deb - sudo dpkg -i --force-confnew elasticsearch-6.3.2.deb ...
Read now
Unlock full access