diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 460daff..cb8ce21 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,17 +57,24 @@ release: stage: release when: manual variables: - TWINE_USERNAME: gitlab-ci-token # Keep username the same - TWINE_PASSWORD: $CI_JOB_TOKEN # Use PAT stored in GitLab CI/CD Variables + TWINE_USERNAME: gitlab-ci-token + TWINE_PASSWORD: $CI_JOB_TOKEN script: - - echo "Setting up Python dependencies..." - - source $VIRTUAL_ENV/bin/activate - - pip install -r requirements.txt - - mkdir -p /app/backend/ssl - - rm -f openapi.json || true - - rm -rf python-client || true - - bash make_openapi_client.sh # Generate OpenAPI client and package - - ls backend/python-client/dist/ # Debug artifacts to ensure files exist + # build and run commands within docker container context + - docker-compose build backend + + # Run commands inside your 'backend' service container + - docker-compose run --rm backend mkdir -p /app/backend/ssl + - docker-compose run --rm backend bash make_openapi_client.sh + + # After script finishes execution within the container, + # revert to the runner environment context if needed + # Assuming 'python-client' is generated and mounted correctly, + # subsequent twine commands must be run out of the container + + - ls backend/python-client/dist/ # Ensure files exist + + # install further publishing requirements outside of docker - pip install --upgrade build setuptools wheel twine - twine check backend/python-client/dist/* - twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi backend/python-client/dist/* \ No newline at end of file