Tidy up docker-compose and makefile

This commit is contained in:
James Allen 2017-11-29 13:49:36 +00:00
parent 3e90103d9c
commit 50b3045548
4 changed files with 10 additions and 10 deletions

View file

@ -1,4 +1,5 @@
NPM := docker-compose -f docker-compose.yml ${DOCKER_COMPOSE_FLAGS} run --rm npm npm
DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
NPM := docker-compose ${DOCKER_COMPOSE_FLAGS} run --rm npm npm
BUILD_NUMBER ?= local
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
PROJECT_NAME = web
@ -41,20 +42,20 @@ docker-shared.yml:
test: test_unit test_acceptance
test_unit: docker-shared.yml
docker-compose -f docker-compose.yml ${DOCKER_COMPOSE_FLAGS} run --rm test_unit npm run test:unit -- ${MOCHA_ARGS}
docker-compose ${DOCKER_COMPOSE_FLAGS} run --rm test_unit npm run test:unit -- ${MOCHA_ARGS}
test_acceptance: test_acceptance_app test_acceptance_modules
test_acceptance_app: test_acceptance_app_start_service test_acceptance_app_run test_acceptance_app_stop_service
test_acceptance_app_start_service: docker-shared.yml
docker-compose -f docker-compose.yml ${DOCKER_COMPOSE_FLAGS} up -d test_acceptance
test_acceptance_app_start_service: test_acceptance_app_stop_service docker-shared.yml
docker-compose ${DOCKER_COMPOSE_FLAGS} up -d test_acceptance
test_acceptance_app_stop_service: docker-shared.yml
docker-compose -f docker-compose.yml ${DOCKER_COMPOSE_FLAGS} stop test_acceptance redis mongo
docker-compose ${DOCKER_COMPOSE_FLAGS} stop test_acceptance redis mongo
test_acceptance_app_run: docker-shared.yml
docker-compose -f docker-compose.yml ${DOCKER_COMPOSE_FLAGS} exec -T test_acceptance npm run test:acceptance -- ${MOCHA_ARGS}
docker-compose ${DOCKER_COMPOSE_FLAGS} exec -T test_acceptance npm run test:acceptance -- ${MOCHA_ARGS}
test_acceptance_modules: docker-shared.yml
for dir in modules/*; \

View file

@ -35,7 +35,7 @@ module.exports = settings =
# Databases
# ---------
mongo:
url : "mongodb://#{process.env['MONGO_HOST'] || '127.0.0.1'}/sharelatex"
url : process.env['MONGO_URL'] || "mongodb://127.0.0.1/sharelatex"
redis:
web:

View file

@ -22,9 +22,8 @@ services:
service: app
environment:
REDIS_HOST: redis
MONGO_HOST: mongo
MONGO_URL: "mongodb://mongo/sharelatex"
SHARELATEX_ALLOW_PUBLIC_ACCESS: 'true'
LISTEN_ADDRESS: 0.0.0.0
depends_on:
- redis
- mongo

View file

@ -13,7 +13,7 @@
"test:acceptance:wait_for_app": "echo 'Waiting for app to be accessible' && while (! curl -s -o /dev/null localhost:3000/status) do sleep 1; done",
"test:acceptance:run": "bin/acceptance_test $@",
"test:acceptance:dir": "npm run compile:acceptance_tests && npm run test:acceptance:wait_for_app && npm run test:acceptance:run -- $@",
"test:acceptance": "npm run test:acceptance:dir test/acceptance/js",
"test:acceptance": "npm run test:acceptance:dir -- $@ test/acceptance/js",
"test:unit": "npm run compile:app && npm run compile:unit_tests && bin/unit_test $@",
"compile:unit_tests": "bin/compile_unit_tests",
"compile:acceptance_tests": "bin/compile_acceptance_tests",