Update CI to read version from pyproject.toml

This commit is contained in:
Tulir Asokan 2022-04-26 14:52:05 +03:00
parent de57c8bc9b
commit fe1596fd8b

View File

@ -13,7 +13,7 @@ build amd64:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker pull $CI_REGISTRY_IMAGE:latest || true
- synversion=$(cat synapse/__init__.py | grep '__version__ = "' | sed -E 's/^__version__ = "(.+)"$/\1/')
- synversion=$(cat pyproject.toml | grep '^version =' | sed -E 's/^version = "(.+)"$/\1/')
- docker build --pull --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$synversion .
- docker push $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:$synversion