Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ESAP DB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
ESCAPE WP5
ESAP DB
Commits
5ccff3d3
Commit
5ccff3d3
authored
3 years ago
by
Pierre Chanial
Browse files
Options
Downloads
Patches
Plain Diff
Run tests in CI.
parent
73d4d17b
No related branches found
No related tags found
1 merge request
!7
Resolve "Run tests in CI"
Pipeline
#15331
passed
3 years ago
Stage: build
Stage: test
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+48
-0
48 additions, 0 deletions
.gitlab-ci.yml
Dockerfile
+1
-1
1 addition, 1 deletion
Dockerfile
host-files/docker-compose.yml
+24
-25
24 additions, 25 deletions
host-files/docker-compose.yml
with
73 additions
and
26 deletions
.gitlab-ci.yml
0 → 100644
+
48
−
0
View file @
5ccff3d3
image
:
name
:
docker/compose:latest
stages
:
-
build
-
test
cache
:
paths
:
-
host-files/docker-stack.yml
variables
:
DBADMIN_USER
:
postgres
DBADMIN_PASSWORD
:
postgres
DBPROJECT_USER
:
postgres
DBPROJECT_PASSWORD
:
postgres
DOMAIN
:
localhost
ESAP_DB_IMAGE
:
${CI_REGISTRY_IMAGE}:latest
before_script
:
-
docker version
-
docker-compose version
build
:
stage
:
build
variables
:
DOMAIN
:
backend
SMTP_HOST
:
"
"
TRAEFIK_PUBLIC_NETWORK_IS_EXTERNAL
:
"
false"
INSTALL_DEV
:
"
true"
artifacts
:
paths
:
-
host-files/docker-stack.yml
expire_in
:
1 week
script
:
-
docker-compose -f host-files/docker-compose.yml config > host-files/docker-stack.yml
-
docker-compose -f host-files/docker-stack.yml build
-
echo ${CI_JOB_TOKEN} | docker login -u "${CI_REGISTRY_USER}" --password-stdin "${CI_REGISTRY}"
-
docker push ${ESAP_DB_IMAGE}
test-functional
:
stage
:
test
script
:
-
docker-compose -f host-files/docker-stack.yml down -v --remove-orphans
-
docker-compose -f host-files/docker-stack.yml pull
-
docker-compose -f host-files/docker-stack.yml up -d
-
docker-compose -f host-files/docker-stack.yml exec -T esap-db bash /code/scripts/run-tests.sh
-
docker-compose -f host-files/docker-stack.yml down -v --remove-orphans
This diff is collapsed.
Click to expand it.
Dockerfile
+
1
−
1
View file @
5ccff3d3
...
...
@@ -26,5 +26,5 @@ RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; els
ARG
INSTALL_JUPYTER=false
RUN
bash
-c
"if [
$INSTALL_JUPYTER
== 'true' ] ; then pip install jupyterlab ; fi"
COPY
.
/app
/code
COPY
. /code
ENV
PYTHONPATH=/code
This diff is collapsed.
Click to expand it.
host-files/docker-compose.yml
+
24
−
25
View file @
5ccff3d3
...
...
@@ -2,28 +2,8 @@ version: "3"
services
:
dbadmin
:
image
:
postgres:12
ports
:
-
"
5432:5432"
environment
:
-
POSTGRES_USER=${DBADMIN_USER}
-
POSTGRES_PASSWORD=${DBADMIN_PASSWORD}
-
POSTGRES_DB=dbadmin
dbproject1
:
image
:
postgres:12
expose
:
-
"
5433"
ports
:
-
"
5433:5433"
command
:
-p
5433
environment
:
-
POSTGRES_USER=${DBPROJECT_USER}
-
POSTGRES_PASSWORD=${DBPROJECT_PASSWORD}
esap-db
:
image
:
esap-db:latest
image
:
${ESAP_DB_IMAGE:-
esap-db:latest
}
container_name
:
esap-db
stdin_open
:
true
# docker run -i
tty
:
true
# docker run -t
...
...
@@ -45,14 +25,33 @@ services:
build
:
context
:
..
args
:
INSTALL_DEV
:
${INSTALL_DEV-false}
command
:
bash -c "scripts/prepare-app.sh && uvicorn app.main:app --port 8001 --host 0.0.0.0 --reload"
volumes
:
-
..:/code
INSTALL_DEV
:
${INSTALL_DEV:-false}
command
:
bash -c "/code/scripts/prepare-app.sh && uvicorn app.main:app --port 8001 --host 0.0.0.0 --reload"
ports
:
-
"
8001:8001"
depends_on
:
-
dbadmin
-
dbproject1
dbadmin
:
image
:
postgres:12
ports
:
-
"
5432:5432"
environment
:
-
POSTGRES_USER=${DBADMIN_USER}
-
POSTGRES_PASSWORD=${DBADMIN_PASSWORD}
-
POSTGRES_DB=dbadmin
dbproject1
:
image
:
postgres:12
expose
:
-
"
5433"
ports
:
-
"
5433:5433"
command
:
-p
5433
environment
:
-
POSTGRES_USER=${DBPROJECT_USER}
-
POSTGRES_PASSWORD=${DBPROJECT_PASSWORD}
pgadmin
:
container_name
:
pgadmin
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment