Merge pull request #4337 from Ocelot-Social-Community/clear_env_docker_workflows

Clean env, docker & workflow
This commit is contained in:
Ulf Gebhardt 2021-04-04 18:29:52 +02:00 committed by GitHub
commit 282e65aa0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -194,7 +194,6 @@ jobs:
##########################################################################
# UNIT TESTS BACKEND #####################################################
##########################################################################
# TODO: Why do we need those .envs?
- name: backend | copy env files webapp
run: cp webapp/.env.template webapp/.env
- name: backend | copy env files backend
@ -230,9 +229,8 @@ jobs:
- name: Load Docker Image
run: docker load < /tmp/webapp.tar
##########################################################################
# UNIT TESTS WEBAPP #####################################################
# UNIT TESTS WEBAPP ######################################################
##########################################################################
# TODO: Why do we need those .envs?
- name: backend | copy env files webapp
run: cp webapp/.env.template webapp/.env
- name: backend | copy env files backend
@ -240,5 +238,4 @@ jobs:
- name: backend | docker-compose
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps webapp
- name: webapp | Unit tests
#run: docker run --rm ocelotsocialnetwork/webapp:build yarn run test
run: docker-compose exec -T webapp yarn test

View File

@ -7,9 +7,8 @@ if (require.resolve) {
try {
dotenv.config({ path: require.resolve('../../.env') })
} catch (error) {
if (error.code === 'MODULE_NOT_FOUND') {
console.log('WARN: No `.env` file found in `/app` (docker) or `/backend` (no docker)') // eslint-disable-line no-console
} else {
// This error is thrown when the .env is not found
if (error.code !== 'MODULE_NOT_FOUND') {
throw error
}
}