diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 084f1b88afeeab2caab5ac5aa2e7a2dbd445c8d1..31b8ab81d70bbd4f1a6826dc9ffc01a869e6ec88 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,8 +4,8 @@ stages: - ci - coverage variables: - BACKEND_IMAGE: $CI_REGISTRY_USER/mcserver:latest - FRONTEND_IMAGE: $CI_REGISTRY_USER/mc_frontend:latest + DOCKER_DRIVER: overlay2 + DOCKER_TLS_CERTDIR: "" workflow: rules: - if: '$CI_COMMIT_TAG' @@ -20,19 +20,16 @@ tag_version: - apk add --no-cache git - python3 ./mc_frontend/update_version.py build: - image: docker:20.10.8 + image: docker:24.0.5 services: - - docker:20.10.8-dind + - docker:24.0.5-dind stage: build script: - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD - - docker build ./mc_frontend -t $FRONTEND_IMAGE - - docker push $FRONTEND_IMAGE - - docker build -f ./mc_backend/Dockerfile -t $BACKEND_IMAGE . - - docker push $BACKEND_IMAGE - variables: - DOCKER_DRIVER: overlay2 - DOCKER_TLS_CERTDIR: "" + - docker compose build mcserver + - docker compose push mcserver + - docker compose build mc_frontend + - docker compose push mc_frontend ci_frontend: artifacts: paths: @@ -44,9 +41,6 @@ ci_frontend: stage: ci script: - docker run --rm $FRONTEND_IMAGE npm run test-ci > ci_frontend.log - variables: - DOCKER_DRIVER: overlay2 - DOCKER_TLS_CERTDIR: "" ci_backend: artifacts: paths: @@ -58,9 +52,6 @@ ci_backend: stage: ci script: - docker run --env IS_THIS_A_DOCKER_CONTAINER=Yes --rm --entrypoint="./coverage_backend.sh" $BACKEND_IMAGE > ci_backend.log - variables: - DOCKER_DRIVER: overlay2 - DOCKER_TLS_CERTDIR: "" coverage: artifacts: paths: diff --git a/README.md b/README.md index 6bb3398cacc5bf11aaa232289429dea97a7ba0a6..61f7c5a49ec513ddaac23ad214542c1e5f9f61c8 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ To generate class structures for this project automatically: 1. Install OpenAPI Generator (using, e.g., `brew install openapi-generator`). 2. + Run: `openapi-generator generate -i mc_backend/mcserver/mcserver_api.yaml -g typescript-angular -o mc_frontend/openapi/ && openapi-generator generate -i mc_backend/mcserver/mcserver_api.yaml -g python-flask -o mc_backend/openapi/ && python mc_backend/openapi_generator.py` . @@ -68,6 +69,7 @@ To update the changelog, use: `git log --oneline --decorate > CHANGELOG` To test your code locally, run `./coverage_local.sh` (all components) or `docker compose run --rm --entrypoint="./coverage_backend.sh" mcserver` (only backend). -To test the GitLab CI locally, run `gitlab-runner exec docker --docker-privileged --env CI_REGISTRY_USER=YOUR_USERNAME JOB_NAME`. -Do not forget to insert your actual GitLab username. The `JOB_NAME` should be replaced by an actual job name from the -YAML configuration. +To test the GitLab CI locally, run `gitlab-runner exec docker --docker-privileged JOB_NAME`. +Do not forget to specify the username and password for your chosen package registry (e.g., Docker). You can do this in +the .gitlab-ci.yml variables, or in the GitLab UI, using `CI_REGISTRY_USER` and `CI_REGISTRY_PASSWORD`. +The `JOB_NAME` should be replaced by an actual job name from the YAML configuration.