Skip to content

Commit

Permalink
Added vtfk test and prod deployment profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsAnd committed Jun 16, 2020
1 parent edbba51 commit d651296
Show file tree
Hide file tree
Showing 4 changed files with 356 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ jspm_packages
.node_repl_history

# Env
.env
.env
.vercel
175 changes: 175 additions & 0 deletions now-prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"version": 2,
"name": "minelev-logs-stats",
"scope": "vtfk",
"alias": [
"stats.minelev.vtfk.no"
],
"env": {
"NODE_ENV": "production",
"MONGODB_CONNECTION": "@minelev-prod-db-connection-read",
"MONGODB_COLLECTION": "@minelev-prod-db-collection-logs",
"MONGODB_COLLECTION_TJOMMI": "@minelev-prod-db-collection-pifu",
"MONGODB_NAME": "@minelev-prod-db-name"
},
"builds": [
{
"src": "/README.md",
"use": "@now/md"
},
{
"src": "/api/*.js",
"use": "@now/node"
}
],
"routes": [
{
"src": "/",
"dest": "/README.html"
},
{
"src": "/favicon.ico",
"dest": "/static/favicon.ico"
},
{
"src": "/stats/total",
"dest": "/api/total.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/total/category/(.*)",
"dest": "/api/category-total.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/total/(.*)",
"dest": "/api/total.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/email",
"dest": "/api/email.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/queue",
"dest": "/api/queue.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/usage",
"dest": "/api/usage.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/usage/(.*)",
"dest": "/api/usage.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/time",
"dest": "/api/time.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/time/(.*)",
"dest": "/api/time.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/schools",
"dest": "/api/schools.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/schools/category/(.*)",
"dest": "/api/category-schools.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/schools/(.*)",
"dest": "/api/schools.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/classes",
"dest": "/api/groups.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/classes/category/(.*)",
"dest": "/api/category-classes.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/classes/(.*)",
"dest": "/api/groups.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/categories",
"dest": "/api/categories.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/students",
"dest": "/api/students-total.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/(.*)",
"dest": "/README.html"
}
]
}
175 changes: 175 additions & 0 deletions now-test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"version": 2,
"name": "minelev-logs-stats-test",
"scope": "vtfk",
"alias": [
"stats.minelev.vtfk.dev"
],
"env": {
"NODE_ENV": "production",
"MONGODB_CONNECTION": "@minelev-test-db-connection-read",
"MONGODB_COLLECTION": "@minelev-test-db-collection-logs",
"MONGODB_COLLECTION_TJOMMI": "@minelev-test-db-collection-pifu",
"MONGODB_NAME": "@minelev-test-db-name"
},
"builds": [
{
"src": "/README.md",
"use": "@now/md"
},
{
"src": "/api/*.js",
"use": "@now/node"
}
],
"routes": [
{
"src": "/",
"dest": "/README.html"
},
{
"src": "/favicon.ico",
"dest": "/static/favicon.ico"
},
{
"src": "/stats/total",
"dest": "/api/total.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/total/category/(.*)",
"dest": "/api/category-total.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/total/(.*)",
"dest": "/api/total.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/email",
"dest": "/api/email.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/queue",
"dest": "/api/queue.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/usage",
"dest": "/api/usage.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/usage/(.*)",
"dest": "/api/usage.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/time",
"dest": "/api/time.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/time/(.*)",
"dest": "/api/time.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/schools",
"dest": "/api/schools.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/schools/category/(.*)",
"dest": "/api/category-schools.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/schools/(.*)",
"dest": "/api/schools.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/classes",
"dest": "/api/groups.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/classes/category/(.*)",
"dest": "/api/category-classes.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/classes/(.*)",
"dest": "/api/groups.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/categories",
"dest": "/api/categories.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/students",
"dest": "/api/students-total.js",
"headers": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
}
},
{
"src": "/stats/(.*)",
"dest": "/README.html"
}
]
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
"coverage": "nyc ava",
"coveralls": "nyc ava && nyc report --reporter=lcov && cat coverage/lcov.info | coveralls",
"standard-fix": "standard --fix",
"deploy": "npm test && now --prod",
"deploy-demo": "npm test && now --local-config now-demo.json --prod",
"deploy": "npm test && now --prod && rm -rf .vercel",
"deploy:prod": "npm test && now --local-config now-prod.json --prod --confirm && rm -rf .vercel",
"deploy:test": "npm test && now --local-config now-test.json --prod --confirm && rm -rf .vercel",
"deploy:demo": "npm test && now --local-config now-demo.json --prod --confirm && rm -rf .vercel",
"dev": "now dev",
"refresh": "rm -rf node_modules && rm package-lock.json && npm install"
},
Expand Down

0 comments on commit d651296

Please sign in to comment.