Get tag from CI

parent ad3ffb6f
Pipeline #1945 passed with stages
in 2 minutes and 16 seconds
build_and_upload:
stages:
- python
- docker
build_and_upload_python_package:
image: python:3.7.3
stage: python
script:
- pip3 install -U twine
- pip3 install -U twine setuptools
- if [ "$(python setup.py --version)" != "$CI_COMMIT_TAG" ]; then echo 'Tag does not match version'; exit 1; fi
- python3 setup.py sdist bdist_wheel
- python3 -m twine upload -u $PYPI_USERNAME -p $PYPI_PASSWORD dist/*
- python3 -m twine upload -u $PYPI_USERNAME -p $PYPI_PASSWORD dist/akinaka-$CI_COMMIT_TAG*
only:
- tags
build_and_upload_image:
image: docker:stable
stage: docker
services:
- docker:dind
dependencies:
- build_and_upload_python_package
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
stage: build
AKINAKA_VERSION: $CI_COMMIT_TAG
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.olindata.com
- docker build -t registry.olindata.com/olindata/akinaka/akinaka:latest .
- docker push registry.olindata.com/olindata/akinaka/akinaka:latest
# FIXME: Get tag from setup.py or "build_and_upload" step above
- docker build --build-arg AKINAKA_VERSION=${AKINAKA_VERSION} -t registry.olindata.com/olindata/akinaka/akinaka:$CI_COMMIT_TAG .
- docker push registry.olindata.com/olindata/akinaka/akinaka:$CI_COMMIT_TAG
only:
- tags
FROM python:3.7.3
RUN pip install akinaka
ARG AKINAKA_VERSION
RUN pip install akinaka==${AKINAKA_VERSION}
ENTRYPOINT ["akinaka.py"]
......@@ -6,7 +6,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="akinaka",
python_requires='>=3.3.0',
version="0.2.14",
version="0.2.16",
author="Afraz",
author_email="afraz@olindata.com",
description="OlinData's aws cli Extras",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment