variables: DOCKER_TAG: "${CI_COMMIT_SHA}" PIPENV_VENV_IN_PROJECT: "true" stages: - build - test - package - ship - run-downstreams image: python:3.8 whl: stage: build before_script: - pip install pipenv - pipenv requirements > requirements.txt script: - python setup.py sdist bdist_wheel artifacts: paths: - dist/* pytest: stage: test before_script: - pip install pipenv - pipenv install --dev script: - pipenv run pre-commit run --all-files - pipenv run pytest cache: paths: - .venv/* except: - tags .dockerize: stage: package services: - docker:19.03.13-dind image: docker:19.03.13 dockerize: extends: .dockerize script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker build --pull -t "$CI_REGISTRY_IMAGE:$DOCKER_TAG" . - docker push "$CI_REGISTRY_IMAGE:$DOCKER_TAG" only: - branches docker-sign: extends: .dockerize script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker pull "$CI_REGISTRY_IMAGE:$DOCKER_TAG" - docker tag "$CI_REGISTRY_IMAGE:$DOCKER_TAG" "$CI_REGISTRY_IMAGE:${CI_COMMIT_TAG#v}" - docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_TAG#v}" - docker tag "$CI_REGISTRY_IMAGE:$DOCKER_TAG" "$CI_REGISTRY_IMAGE:latest" - docker push "$CI_REGISTRY_IMAGE:latest" only: - tags pypi: stage: ship before_script: - pip install pipenv twine - pipenv requirements > requirements.txt script: - python setup.py verify - TWINE_USERNAME="gitlab-ci-token" TWINE_PASSWORD="${CI_JOB_TOKEN}" python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/* needs: - whl rules: - if: "$CI_COMMIT_TAG" release-jupyterlab-streaming: stage: run-downstreams inherit: variables: false variables: STREAMING_CLI_VERSION: "${CI_COMMIT_TAG}" trigger: project: 'getindata/streaming-labs/docker-images/jupyterlab-streaming' branch: 'main' needs: - pypi rules: - if: "$CI_COMMIT_TAG"