Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
22459a6
docker compose dev and test contatiners sepation init
xsalonx Jul 26, 2023
90af4bf
dev containers handling refactor
xsalonx Jul 26, 2023
872aa5e
cases order refactor
xsalonx Jul 26, 2023
576b851
unused var removed
xsalonx Jul 26, 2023
0107490
moved definition of names
xsalonx Jul 26, 2023
9681f9a
TODO
xsalonx Jul 26, 2023
7f9dbe6
containers naming simplified
xsalonx Jul 26, 2023
f7e2ae4
targeting refactor
xsalonx Jul 26, 2023
781e96a
substage 'create' added
xsalonx Jul 26, 2023
bcf26e1
removed unncecessary comment
xsalonx Jul 26, 2023
e48c442
contatiners names vars rename
xsalonx Jul 27, 2023
e5336fb
renaming, docs update
xsalonx Jul 27, 2023
8b34dec
logs stage added
xsalonx Jul 27, 2023
2359c69
dump:remove fixup
xsalonx Jul 27, 2023
e1ef565
refactor
xsalonx Jul 27, 2023
d15a4c0
sourcing env, renaming
xsalonx Jul 27, 2023
fb5fc54
unnecesary env file deleted
xsalonx Jul 27, 2023
7844113
volumes refactor
xsalonx Jul 27, 2023
e01ca53
docker containers build scripts, conf files simplified
xsalonx Jul 27, 2023
a763135
npm task update in githbu workflow
xsalonx Jul 27, 2023
1662f16
unnecessary steps in github actioins deleted
xsalonx Jul 27, 2023
13133d6
working dirs redefined
xsalonx Jul 27, 2023
58e32d9
typo
xsalonx Jul 27, 2023
2ee419d
test breaking dev environment fixed
xsalonx Jul 27, 2023
d3ee18a
github workflow amend
xsalonx Jul 27, 2023
b86ad71
tmp commit
xsalonx Jul 27, 2023
a23435c
test pipline update
xsalonx Jul 27, 2023
5aab900
test amend
xsalonx Jul 27, 2023
f2baf68
cleanup
xsalonx Jul 27, 2023
2f5c9c0
new lines
xsalonx Jul 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 0 additions & 79 deletions .env.test

This file was deleted.

21 changes: 2 additions & 19 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Tests
## TODO

on:
pull_request:
push:
Expand All @@ -20,8 +20,7 @@ jobs:
with:
node-version: '18.x'
- run: npm ci
- run: npm run docker:test
# - run: ./node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov
- run: npm run test
- name: Send codecov report for RunConditionTable
uses: codecov/codecov-action@v3
with:
Expand All @@ -43,19 +42,3 @@ jobs:
- name: Running static analysis
run: npm run static

test:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install mocha
run: npm install -g mocha
- name: Installing dependencies
run: npm ci
- name: Running tests
run: npm run docker:test
17 changes: 3 additions & 14 deletions docker/application.dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
FROM node:18.16.0-buster as base

WORKDIR /opt/RunConditionTable

RUN apt update -y && apt install -y \
netcat \
bash

COPY ./package*.json ./
RUN npm --silent ci


FROM base as development
FROM base as dev
RUN apt update -y && apt install -y \
postgresql-client

CMD [ "./scripts/check-host-and-exec.sh", "o2-rct_database", "5432", "10", "--", "npm", "run", "start:dev" ]


FROM base as test

COPY ./.eslintrc ./
COPY ./.nycrc ./
COPY ./codecov.yml ./
COPY ./test ./test
COPY ./app ./app
COPY ./scripts ./scripts

CMD [ "./scripts/check-host-and-exec.sh", "o2-rct_database-test", "5432", "10", "--", "npm", "run", "test" ]
10 changes: 1 addition & 9 deletions docker/database.dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
FROM postgres:14.2-bullseye as base

WORKDIR /postgres/run

FROM base as development
FROM base as dev
RUN apt update -y && \
apt install -y \
sudo \
procps \
inotify-tools

FROM base as test






5 changes: 1 addition & 4 deletions docker/dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ RCT_OPENID_WELL_KNOWN=${RCT_OPENID_WELL_KNOWN:-}

## database configuration
### common vars
RCT_DB_HOST=${RCT_DB_HOST:-o2-rct_database}
RCT_DB_HOST=${DB_CONTATINER_NAME:-${RCT_DB_HOST:-o2rct_database-dev}}
RCT_DB_UNIXSS=${RCT_DB_UNIXSS:-/var/run/postgresql}
RCT_DB_NAME=${RCT_DB_NAME:-rct-db}
RCT_DB_PORT=5432
Expand All @@ -92,6 +92,3 @@ POSTGRES_HOST_AUTH_METHOD=scram-sha-256
MOCK_DB=${MOCK_DB:-false}
OTHER_SQL_MODIFY_DAEMON=${OTHER_SQL_MODIFY_DAEMON:-true}
MAIN_SQL_MODIFY_DAEMON=${MAIN_SQL_MODIFY_DAEMON:-true}



4 changes: 2 additions & 2 deletions docker/docker-compose-db-expose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
o2-rct_database:
database:
ports:
- target: $RCT_DB_PORT
published: $DB_EXPOSED_PORT
published: $DB_EXPOSED_PORT
53 changes: 37 additions & 16 deletions docker/docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,46 @@

services:
o2-rct_application:
container_name: o2-rct_application
build:
target: development
env_file:
- ./docker/dev.env

application:
restart: "no"
ports:
- target: $RCT_HTTP_PORT
published: $RCT_HTTP_PORT


volumes:
- type: bind
read_only: false
source: ./database/cache
target: /opt/RunConditionTable/database/cache
bind:
create_host_path: true
- type: bind
read_only: true
source: ./security
target: /opt/RunConditionTable/security
bind:
create_host_path: true

database:
restart: "no"

o2-rct_database:
container_name: o2-rct_database
build:
target: development

env_file:
- ./docker/dev.env
volumes:
- type: bind
read_only: true
source: ./database
target: /postgres/run/database
- type: bind
read_only: false
source: ./database/cache
target: /postgres/run/database/cache
bind:
create_host_path: true


restart: "no"
networks:
network:
driver: bridge
ipam:
driver: default
config:
- subnet: "172.200.201.0/24"
gateway: "172.200.201.1"
13 changes: 13 additions & 0 deletions docker/docker-compose-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

services:
application:
build:
target: $TARGET
env_file:
- ./docker/$TARGET.env

database:
build:
target: $TARGET
env_file:
- ./docker/$TARGET.env
61 changes: 28 additions & 33 deletions docker/docker-compose-test.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@

services:
o2-rct_application:
container_name: o2-rct_application-test
build:
target: test
env_file:
- ./docker/test.env
application:
restart: "no"
volumes:
- type: bind
read_only: true
source: ./security
target: /opt/RunConditionTable/security
- type: bind
read_only: false
source: ./database/cache
target: /opt/RunConditionTable/database/cache
- type: bind
read_only: false
source: ./reports
target: /opt/RunConditionTable/reports

restart: "no"
bind:
create_host_path: true
- type: bind
read_only: true
source: ./.eslintrc
target: /opt/RunConditionTable/.eslintrc

o2-rct_database:
container_name: o2-rct_database-test
build:
target: test
env_file:
- ./docker/test.env
- type: bind
read_only: true
source: ./.nycrc
target: /opt/RunConditionTable/.nycrc

- type: bind
read_only: true
source: ./test
target: /opt/RunConditionTable/test

volumes:
- type: bind
read_only: true
source: ./database
target: /docker-entrypoint-initdb.d
- type: bind
read_only: false
source: ./database/cache
target: /postgres/run/database/cache

database:
restart: "no"


restart: "no"
networks:
network:
driver: bridge
ipam:
driver: default
config:
- subnet: "172.200.202.0/24"
gateway: "172.200.202.1"
28 changes: 7 additions & 21 deletions docker/docker-compose-volumes.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
version: '3.1'
services:
o2-rct_application:
application:
volumes:
- type: bind
read_only: false
read_only: true
source: ./app
target: /opt/RunConditionTable/app
- type: bind
read_only: false
source: ./app/public/ # must be directory due to read_only flag conflict with previous bind
target: /opt/RunConditionTable/app/public/
- type: bind
read_only: true
source: ./scripts
Expand All @@ -18,28 +22,10 @@ services:
read_only: true
source: ./package-lock.json
target: /opt/RunConditionTable/package-lock.json
- type: bind
read_only: true
source: ./security
target: /opt/RunConditionTable/security
- type: bind
read_only: false
source: ./database/cache
target: /opt/RunConditionTable/database/cache
- type: bind
read_only: false
source: ./reports
target: /opt/RunConditionTable/reports

o2-rct_database:
database:
volumes:
- type: bind
read_only: true
source: ./database
target: /docker-entrypoint-initdb.d
- type: bind
read_only: false
source: ./database/cache
target: /postgres/run/database/cache


Loading