-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
40 lines (40 loc) · 1.5 KB
/
.travis.yml
File metadata and controls
40 lines (40 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# javascript === node_js
language: node_js
# minimum version of node required to run your app
node_js:
- "14"
#distribution, base image for virtual machine Travis will make for us -- like Ubuntu or Debian
#small version (VM) of Linux
# dist === OS of our virtual machine for Travis
dist: trusty
#services === pieces of "outside" software we need to run our app -- e.g. databases, modules
services:
- mongodb
- redis-server
# array of environment variables, w/c we need to run app in VM .. i.e. from ur config/keys
# env === array of env variables you want set for Travis VM
env:
# note: these have to be combined in 1 line, or else 2 separate builds will be created
- NODE_ENV=ci PORT=3000
# after Travis installs node_modules atleast 1 time, will CACHE it for future builds
cache:
directories:
# AdvancedNodeStarter dir's node_modules
- node_modules
# client dir's node_modules
- client/node_modules
# commands u want Travis to run at command line, e.g. for SETUP
# install === array of setup command line scripts
install:
- npm install
# specific to this project
- npm run build
# like install, but runs after inistall
script:
# npm run start === by default / by itself, solely focuses on that command by default. can't run any other commands
# nohup === will allow other commands to be executed WHILE npm run start is running
# & === run underlying command in a subshell / "in background mode"
- nohup npm run start &
# give ur server time to execute / run itself
- sleep 3
- npm run test