mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix workflow
- run test environment - use start instead of dev to enforce restarts - migrate database - log database connection errors
This commit is contained in:
parent
0bc8115e0d
commit
089732862c
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -381,7 +381,7 @@ jobs:
|
|||||||
# UNIT TESTS BACKEND #####################################################
|
# UNIT TESTS BACKEND #####################################################
|
||||||
##########################################################################
|
##########################################################################
|
||||||
- name: backend | docker-compose
|
- name: backend | docker-compose
|
||||||
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps mariadb backend
|
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps mariadb database backend
|
||||||
- name: backend Unit tests | test
|
- name: backend Unit tests | test
|
||||||
run: docker-compose exec -T backend yarn test
|
run: docker-compose exec -T backend yarn test
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|||||||
@ -73,7 +73,7 @@ RUN yarn run build
|
|||||||
FROM build as test
|
FROM build as test
|
||||||
|
|
||||||
# Run command
|
# Run command
|
||||||
CMD /bin/sh -c "yarn run dev"
|
CMD /bin/sh -c "yarn run start"
|
||||||
|
|
||||||
##################################################################################
|
##################################################################################
|
||||||
# PRODUCTION (Does contain only "binary"- and static-files to reduce image size) #
|
# PRODUCTION (Does contain only "binary"- and static-files to reduce image size) #
|
||||||
|
|||||||
@ -16,7 +16,10 @@ const connection = async (): Promise<Connection | null> => {
|
|||||||
entities: [path.join(__dirname, 'entity', '*.{ts,js}')],
|
entities: [path.join(__dirname, 'entity', '*.{ts,js}')],
|
||||||
synchronize: false,
|
synchronize: false,
|
||||||
})
|
})
|
||||||
} catch (error) {}
|
} catch (error) {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
|
||||||
return con
|
return con
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,20 @@ version: "3.4"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
|
########################################################
|
||||||
|
# BACKEND ##############################################
|
||||||
|
########################################################
|
||||||
|
backend:
|
||||||
|
image: gradido/backend:test
|
||||||
|
build:
|
||||||
|
target: test
|
||||||
|
networks:
|
||||||
|
- external-net
|
||||||
|
- internal-net
|
||||||
|
environment:
|
||||||
|
- NODE_ENV="test"
|
||||||
|
- DB_HOST=mariadb
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
## MARIADB ##############################################
|
## MARIADB ##############################################
|
||||||
#########################################################
|
#########################################################
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user