diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..ec70a1bd1d504f2770f92b4316a7b016964148c1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,91 @@ +include: + - project: piacere/private/t23-ci-setup + ref: main + file: + - gitlab-ci-scripts/utils.gitlab-ci.yml + + # Image tag variables generation job ------------- + # Stage: variable-generation --------------------- + - gitlab-ci-scripts/generate-variables.gitlab-ci.yml + + # Downstream t23-ci-setup pipeline trigger job --- + # Stage: integration-tests-publish-deploy -------- + - gitlab-ci-scripts/trigger-downstream.gitlab-ci.yml + +variables: + # ------------------------ + # Component image tag data + # ------------------------ + COMPONENT_WP: wp4 + DMC_IMAGE_NAME: dmc + + # ------------------------------------------ + # Space-separated component image abbreviation list + # used to generate image tags and related variables. + # It is also passed to the downstream integration tests, + # publication and deployment pipeline + # ------------------------------------------ + IMAGE_NAMES: "$DMC_IMAGE_NAME" + +stages: + - variable-generation + - build + - security + - functional-tests + - integration-tests-publish-deploy + +# Build jobs ---------------------- + +build-temp-dmc: + stage: build + variables: + TMP_IMAGE: "$TMP_IMAGE_DMC" + DOCKERFILE_PATH: "." + trigger: !reference [.trigger-build] + rules: + - if: $CI_COMMIT_BRANCH =~ /^y3/ + +# Security job ------------------------ + +security-trivy-dmc: + stage: security + variables: + TMP_IMAGE: "$TMP_IMAGE_DMC" + trigger: !reference [.trigger-security-trivy] + needs: + - job: build-temp-dmc + - job: generate-variables + artifacts: true + rules: + - if: $CI_COMMIT_BRANCH =~ /^y3/ + +# functional tests job ------------------------ + +run-functional-tests: + image: $DOCKER_IMAGE + stage: functional-tests + services: + - $DOCKER_DIND_IMAGE + variables: + TESTS_CONTAINER_NAME: functional-tester + before_script: + - !reference [.artifactory-login] + script: + # Tests assume port 8080, while the Dockerfile CMD runs the server on port 80. + # Thus, we need to override the command so that the server is run on port 8080. + - docker run --name $TESTS_CONTAINER_NAME -d -e "UVICORN_PORT=8080" $TMP_IMAGE_DMC + # Install everything required for the tests. + - docker exec -i $TESTS_CONTAINER_NAME /bin/bash -c + "pip install -r requirements.txt" + # Run the tests. + - docker exec -i $TESTS_CONTAINER_NAME /bin/bash -c "python -m pytest tests/test_mc_openapi.py -n auto" + # Stop the tests container. + - docker stop $TESTS_CONTAINER_NAME + needs: + - job: build-temp-dmc + - job: generate-variables + artifacts: true + tags: + - docker + rules: + - if: $CI_COMMIT_BRANCH =~ /^y3/ diff --git a/requirements.txt.old b/requirements.txt.old deleted file mode 100644 index d03d7da597fea86daaf08eb48ae0f62403f8f17e..0000000000000000000000000000000000000000 --- a/requirements.txt.old +++ /dev/null @@ -1,57 +0,0 @@ -alabaster==0.7.13 -attrs==22.2.0 -Babel==2.11.0 -beautifulsoup4==4.11.1 -certifi==2022.12.7 -charset-normalizer==3.0.1 -click==8.1.3 -clickclick==20.10.2 -connexion==2.14.2 -docutils==0.19 -Flask==2.2.2 -furo==2022.12.7 -future-fstrings==1.2.0 -h11==0.14.0 -idna==3.4 -imagesize==1.4.1 -inflection==0.5.1 -iniconfig==2.0.0 -itsdangerous==2.1.2 -Jinja2==3.1.2 -joblib==1.2.0 -jsonschema==4.17.3 -lark==1.1.5 -lxml==4.9.2 -MarkupSafe==2.1.2 -networkx==3.0 -ordered-set==4.1.0 -packaging==23.0 -piacere-doml-synthesis==2023.1.3 -pluggy==1.0.0 -pyecore==0.13.0 -Pygments==2.14.0 -pyrsistent==0.19.3 -pytest==7.2.1 -pytz==2022.7.1 -PyYAML==6.0 -requests==2.28.2 -RestrictedPython==6.0 -snowballstemmer==2.2.0 -soupsieve==2.3.2.post1 -Sphinx==6.1.3 -sphinx-basic-ng==1.0.0b1 -sphinxcontrib-applehelp==1.0.4 -sphinxcontrib-devhelp==1.0.2 -sphinxcontrib-htmlhelp==2.0.0 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.3 -sphinxcontrib-serializinghtml==1.1.5 -swagger-ui-bundle==0.0.9 -termcolor==2.2.0 -urllib3==1.26.14 -uvicorn==0.20.0 -Werkzeug==2.2.2 -z3-solver==4.11.2.0 -tabulate==0.9.0 -pytest-xdist==3.3.1 -subtests==0.11.0 \ No newline at end of file