fix linting errors and do stuff to make build work
This commit is contained in:
parent
82059bbfb0
commit
fa5a9e39b2
5 changed files with 37 additions and 19 deletions
18
.travis.yml
18
.travis.yml
|
@ -49,12 +49,12 @@ env:
|
||||||
global:
|
global:
|
||||||
- APP_IMAGE_NAME=p5jswebeditor_app
|
- APP_IMAGE_NAME=p5jswebeditor_app
|
||||||
|
|
||||||
deploy:
|
# deploy:
|
||||||
provider: elasticbeanstalk
|
# provider: elasticbeanstalk
|
||||||
access_key_id: $AWS_ACCESS_KEY
|
# access_key_id: $AWS_ACCESS_KEY
|
||||||
secret_access_key:
|
# secret_access_key:
|
||||||
secure: $AWS_SECRET_KEY
|
# secure: $AWS_SECRET_KEY
|
||||||
region: $AWS_REGION
|
# region: $AWS_REGION
|
||||||
app: $AWS_EBS_APP
|
# app: $AWS_EBS_APP
|
||||||
env: $AWS_EBS_ENV
|
# env: $AWS_EBS_ENV
|
||||||
bucket_name: "the-target-S3-bucket"
|
# bucket_name: "the-target-S3-bucket"
|
|
@ -10,8 +10,8 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- '27017:27017'
|
- '27017:27017'
|
||||||
# restart: always
|
# restart: always
|
||||||
env_file:
|
# env_file:
|
||||||
- .env
|
# - .env
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:1.13
|
image: nginx:1.13
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -25,8 +25,8 @@ services:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
target: production
|
target: production
|
||||||
env_file:
|
# env_file:
|
||||||
- .env
|
# - .env
|
||||||
environment:
|
environment:
|
||||||
- MONGO_URL=mongodb://mongo:27017/p5js-web-editor
|
- MONGO_URL=mongodb://mongo:27017/p5js-web-editor
|
||||||
- MONGO_HOSTNAME=mongo
|
- MONGO_HOSTNAME=mongo
|
||||||
|
|
|
@ -68,11 +68,17 @@ const headers = { 'User-Agent': 'p5js-web-editor/0.0.1' };
|
||||||
|
|
||||||
let mongoConnectionString;
|
let mongoConnectionString;
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
const { MONGO_RW_USERNAME, MONGO_RW_PASSWORD, MONGO_HOSTNAME, MONGO_PORT, MONGO_NAME } = process.env;
|
const {
|
||||||
|
MONGO_RW_USERNAME,
|
||||||
|
MONGO_RW_PASSWORD,
|
||||||
|
MONGO_HOSTNAME,
|
||||||
|
MONGO_PORT,
|
||||||
|
MONGO_NAME
|
||||||
|
} = process.env;
|
||||||
const muo = new URL(`mongodb://${MONGO_HOSTNAME}:${MONGO_PORT}/${MONGO_NAME}`);
|
const muo = new URL(`mongodb://${MONGO_HOSTNAME}:${MONGO_PORT}/${MONGO_NAME}`);
|
||||||
muo.username = MONGO_RW_USERNAME;
|
muo.username = MONGO_RW_USERNAME;
|
||||||
muo.password = MONGO_RW_PASSWORD;
|
muo.password = MONGO_RW_PASSWORD;
|
||||||
mongoConnectionString = muo.href + "?authSource=admin";
|
mongoConnectionString = `${muo.href}?authSource=admin`;
|
||||||
} else {
|
} else {
|
||||||
mongoConnectionString = process.env.MONGO_URL;
|
mongoConnectionString = process.env.MONGO_URL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,11 +38,17 @@ const headers = { 'User-Agent': 'p5js-web-editor/0.0.1' };
|
||||||
|
|
||||||
let mongoConnectionString;
|
let mongoConnectionString;
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
const { MONGO_RW_USERNAME, MONGO_RW_PASSWORD, MONGO_HOSTNAME, MONGO_PORT, MONGO_NAME } = process.env;
|
const {
|
||||||
|
MONGO_RW_USERNAME,
|
||||||
|
MONGO_RW_PASSWORD,
|
||||||
|
MONGO_HOSTNAME,
|
||||||
|
MONGO_PORT,
|
||||||
|
MONGO_NAME
|
||||||
|
} = process.env;
|
||||||
const muo = new URL(`mongodb://${MONGO_HOSTNAME}:${MONGO_PORT}/${MONGO_NAME}`);
|
const muo = new URL(`mongodb://${MONGO_HOSTNAME}:${MONGO_PORT}/${MONGO_NAME}`);
|
||||||
muo.username = MONGO_RW_USERNAME;
|
muo.username = MONGO_RW_USERNAME;
|
||||||
muo.password = MONGO_RW_PASSWORD;
|
muo.password = MONGO_RW_PASSWORD;
|
||||||
mongoConnectionString = muo.href + "?authSource=admin";
|
mongoConnectionString = `${muo.href}?authSource=admin`;
|
||||||
} else {
|
} else {
|
||||||
mongoConnectionString = process.env.MONGO_URL;
|
mongoConnectionString = process.env.MONGO_URL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,11 +47,17 @@ if (process.env.NODE_ENV === 'development') {
|
||||||
|
|
||||||
let mongoConnectionString;
|
let mongoConnectionString;
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
const { MONGO_RW_USERNAME, MONGO_RW_PASSWORD, MONGO_HOSTNAME, MONGO_PORT, MONGO_NAME } = process.env;
|
const {
|
||||||
|
MONGO_RW_USERNAME,
|
||||||
|
MONGO_RW_PASSWORD,
|
||||||
|
MONGO_HOSTNAME,
|
||||||
|
MONGO_PORT,
|
||||||
|
MONGO_NAME
|
||||||
|
} = process.env;
|
||||||
const muo = new URL(`mongodb://${MONGO_HOSTNAME}:${MONGO_PORT}/${MONGO_NAME}`);
|
const muo = new URL(`mongodb://${MONGO_HOSTNAME}:${MONGO_PORT}/${MONGO_NAME}`);
|
||||||
muo.username = MONGO_RW_USERNAME;
|
muo.username = MONGO_RW_USERNAME;
|
||||||
muo.password = MONGO_RW_PASSWORD;
|
muo.password = MONGO_RW_PASSWORD;
|
||||||
mongoConnectionString = muo.href + "?authSource=admin";
|
mongoConnectionString = `${muo.href}?authSource=admin`;
|
||||||
} else {
|
} else {
|
||||||
mongoConnectionString = process.env.MONGO_URL;
|
mongoConnectionString = process.env.MONGO_URL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue