Skip to content

Commit e547eeb

Browse files
authored
add separate config for prod deploys (#493)
1 parent 8d1b829 commit e547eeb

File tree

5 files changed

+53
-50
lines changed

5 files changed

+53
-50
lines changed

.travis.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
11
language: node_js
22

3-
# addons:
4-
# sauce_connect: true
5-
#
6-
# services:
7-
# - mysql
8-
#
9-
# before_install:
10-
# - mysql -uroot -e "CREATE DATABASE jsperf; GRANT ALL ON jsperf.* TO 'jsuser'@'localhost' IDENTIFIED BY 'jspass'; FLUSH PRIVILEGES;"
11-
#
12-
# env:
13-
# - NODE_ENV=test PORT=3000 MYSQL_USER=jsuser MYSQL_PASSWORD=jspass MYSQL_DATABASE=jsperf GITHUB_CALLBACK=http://localhost:3000 BELL_COOKIE_PASS=password-should-be-32-characters COOKIE_PASS=password-should-be-32-characters
14-
15-
before_install:
16-
- npm install -g greenkeeper-lockfile@1
17-
18-
before_script:
19-
- greenkeeper-lockfile-update
20-
21-
script:
22-
- npm test
23-
# - npm start &
24-
# - sleep 3
25-
# - curl -v http://localhost:3000/health
26-
# - npm run test-e2e
3+
sudo: false
274

285
after_script:
29-
- greenkeeper-lockfile-upload
306
- npm install -g codeclimate-test-reporter
317
- codeclimate-test-reporter < lcov.info || echo "Could not upload code coverage to CodeClimate"

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM mhart/alpine-node:8 as base
2+
WORKDIR /usr/src
3+
RUN apk add --no-cache make gcc g++ python
4+
COPY package.json package-lock.json /usr/src/
5+
RUN npm install --production
6+
COPY . .
7+
8+
FROM mhart/alpine-node:base-8
9+
WORKDIR /usr/src
10+
ENV NODE_ENV="production"
11+
COPY --from=base /usr/src .
12+
CMD ["node", "server.js"]

now.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"public": true,
3+
"type": "docker",
4+
"features": {
5+
"cloud": "v2"
6+
},
7+
"env": {
8+
"NODE_ENV": "staging",
9+
"SCHEME": "https"
10+
}
11+
}

now.prod.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"public": true,
3+
"type": "docker",
4+
"features": {
5+
"cloud": "v2"
6+
},
7+
"alias": "jsperf.com",
8+
"env": {
9+
"NODE_ENV": "production",
10+
"SCHEME": "https",
11+
"DOMAIN": "jsperf.com",
12+
"GITHUB_CLIENT_ID": "@jsperf-github-id",
13+
"GITHUB_CLIENT_SECRET": "@jsperf-github-secret",
14+
"GITHUB_CALLBACK": "https://jsperf.com",
15+
"BROWSERSCOPE": "@jsperf-browserscope",
16+
"BELL_COOKIE_PASS": "@jsperf-bell-pass",
17+
"COOKIE_PASS": "@jsperf-cookie-pass",
18+
"MYSQL_USER": "@jsperf-db-user",
19+
"MYSQL_PASSWORD": "@jsperf-db-pass",
20+
"MYSQL_DATABASE": "@jsperf-db-db",
21+
"MYSQL_HOST": "@jsperf-db-host",
22+
"MYSQL_PORT": "@jsperf-db-port",
23+
"LOGGLY_TOKEN": "@jsperf-loggly-token",
24+
"LOGGLY_SUBDOMAIN": "jsperf",
25+
"REDIS_HOST": "@jsperf-redis-host",
26+
"REDIS_PORT": "@jsperf-redis-port",
27+
"REDIS_PASSWORD": "@jsperf-redis-password"
28+
}
29+
}

package.json

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,30 +85,5 @@
8585
"saucelabs": "^1.5.0",
8686
"selenium-webdriver": "^3.6.0",
8787
"sinon": "^4.4.5"
88-
},
89-
"now": {
90-
"alias": "jsperf.com",
91-
"env": {
92-
"NODE_ENV": "production",
93-
"SCHEME": "https",
94-
"DOMAIN": "jsperf.com",
95-
"GITHUB_CLIENT_ID": "@jsperf-github-id",
96-
"GITHUB_CLIENT_SECRET": "@jsperf-github-secret",
97-
"GITHUB_CALLBACK": "https://jsperf.com",
98-
"BROWSERSCOPE": "@jsperf-browserscope",
99-
"BELL_COOKIE_PASS": "@jsperf-bell-pass",
100-
"COOKIE_PASS": "@jsperf-cookie-pass",
101-
"MYSQL_USER": "@jsperf-db-user",
102-
"MYSQL_PASSWORD": "@jsperf-db-pass",
103-
"MYSQL_DATABASE": "@jsperf-db-db",
104-
"MYSQL_HOST": "@jsperf-db-host",
105-
"MYSQL_PORT": "@jsperf-db-port",
106-
"LOGGLY_TOKEN": "@jsperf-loggly-token",
107-
"LOGGLY_SUBDOMAIN": "@jsperf-loggly-subdomain",
108-
"REDIS_HOST": "@jsperf-redis-host",
109-
"REDIS_PORT": "@jsperf-redis-port",
110-
"REDIS_PASSWORD": "@jsperf-redis-password"
111-
},
112-
"public": true
11388
}
11489
}

0 commit comments

Comments
 (0)