.gitlab-ci.yml updated v32
This commit is contained in:
parent
27a9b5ea02
commit
0f38c752cf
2 changed files with 36 additions and 5 deletions
|
|
@ -29,9 +29,6 @@ build:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- mvn clean package -DskipTests -Pdistributive
|
- mvn clean package -DskipTests -Pdistributive
|
||||||
- cd /builds/mfd/clearing/clearing_test
|
|
||||||
- ls -la
|
|
||||||
# - mvn --version
|
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "$CI_COMMIT_REF_NAME"
|
name: "$CI_COMMIT_REF_NAME"
|
||||||
expire_in: 1 day
|
expire_in: 1 day
|
||||||
|
|
@ -40,11 +37,16 @@ build:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
|
variables:
|
||||||
|
CLEARING_TEST_DIR: "/builds/mfd/clearing/clearing_test"
|
||||||
|
CLR_TEST_DIR: "/builds/mfd/clearing/clr_test"
|
||||||
script:
|
script:
|
||||||
|
- apk update && apk add maven python3
|
||||||
- cd clr_test
|
- cd clr_test
|
||||||
- pwd
|
- pwd
|
||||||
- cp -r /builds/mfd/clearing/z-distr/target/clearing/bin ./clearing-all/bin
|
- cp -r /builds/mfd/clearing/z-distr/target/clearing/bin ./clearing-all/bin
|
||||||
- cp -r /builds/mfd/clearing/z-distr/target/clearing/settings ./clearing-all/settings
|
- cp -r /builds/mfd/clearing/z-distr/target/clearing/settings ./clearing-all/settings
|
||||||
- cp /builds/mfd/clearing/z-distr/target/clearing/db/DDL.sql ./db
|
- cp /builds/mfd/clearing/z-distr/target/clearing/db/DDL.sql ./db
|
||||||
- docker-compose down --volumes
|
- python3 run_test_docker_containers.py
|
||||||
- docker compose up --build --force-recreate --abort-on-container-exit --exit-code-from clearing_system
|
# - docker-compose down --volumes
|
||||||
|
# - docker compose up --build --force-recreate --abort-on-container-exit --exit-code-from clearing_system
|
||||||
|
|
|
||||||
29
clr_test/run_test_docker_containers.py
Normal file
29
clr_test/run_test_docker_containers.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
|
DATA_ROOT_DIR = os.environ['CLEARING_TEST_DIR']
|
||||||
|
CLR_TEST_DIR = os.environ['CLR_TEST_DIR']
|
||||||
|
|
||||||
|
|
||||||
|
def run_docker():
|
||||||
|
os.chdir(CLR_TEST_DIR)
|
||||||
|
subprocess.call(["docker", "compose", "down", "--volumes"])
|
||||||
|
subprocess.call(["docker", "compose", "up", "--abort-on-container-exit", "--exit-code-from", "clearing_system"])
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
folders = [i for i in sorted(os.listdir(DATA_ROOT_DIR)) if re.search("\\d{1,}.\\d{1,}.*", i)]
|
||||||
|
for folder in folders:
|
||||||
|
shutil.rmtree(f"{CLR_TEST_DIR}/clearing_testing_utils/store")
|
||||||
|
os.remove(f"{CLR_TEST_DIR}/db/export.sql")
|
||||||
|
os.remove(f"{CLR_TEST_DIR}/db/test-data.sql")
|
||||||
|
shutil.copytree(f"{DATA_ROOT_DIR}/{folder}/", f"{CLR_TEST_DIR}/", dirs_exist_ok=True)
|
||||||
|
run_docker()
|
||||||
|
os.chdir("..")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__=='__main__':
|
||||||
|
main()
|
||||||
Loading…
Add table
Reference in a new issue