# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['determine_docker_tags']

package_data = \
{'': ['*']}

entry_points = \
{'console_scripts': ['determine-docker-tags = '
                     'determine_docker_tags.__init__:main']}

setup_kwargs = {
    'name': 'determine-docker-tags',
    'version': '0.1.7',
    'description': 'A small program to determine docker image tags',
    'long_description': '# determine-docker-tags\n\nA python program used to determine which docker tags should be applied to a docker image depending on various factors. This is mainly intended to be used together with Drone CI to automatically figure out version tags before building a container image.\n\n## Installation\n\nAs this is mainly intended to be used with Drone CI there is a ready to go docker image on [Docker Hub](https://hub.docker.com/r/mwalbeck/determine-docker-tags). You can also find the source for the docker image [here](https://git.walbeck.it/walbeck-it/docker-determine-docker-tags).\n\nIf you\'re not interested in a docker image you can also find it on [PyPi](https://pypi.org/project/determine-docker-tags/) and it can easily be installed with:\n\n```\npip install determine-docker-tags\n```\n\n## Options\n\nHere is a list of the options available. You can find more detailed usage instructions below.\n\n| ENV Var         | Default      | Description                                                                                                                                                                                          |\n| --------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| VERSION_TYPE    | ""           | How the program should find the version number. Can be "docker_env", "docker_from", "date" or "".                                                                                                    |\n| APP_NAME        | ""           | The name of the application whose version number you want to use to generate tags.                                                                                                                   |\n| DOCKERFILE_PATH | "Dockerfile" | The path to the Dockerfile you want to run the program on                                                                                                                                            |\n| APP_ENV         | ""           | A static string to add to the end of every tag with a "-" added inbetween the tag and the string. The string will not be added to any tags defined in CUSTOM_TAGS.                                   |\n| CUSTOM_TAGS     | ""           | Any extra static tags you want to add to the image, for example "latest". You can provide a list in the form of a comma separated string to specify multiple tags. For example "latest,prod,example" |\n| INCLUDE_MAJOR   | "yes"        | If the major version number should be a tag. This setting will be ignored if the major version number is 0. Can be "yes" or "no".                                                                    |\n| INCLUDE_SUFFIX  | "yes"        | If the suffix that you find after the version number in many docker image tags should be kept and added to every tag. Can be "yes" or "no"                                                           |\n\n## Usage\n\nThe program is configured through environment variables. You can see the different options below. The program automatically figures out the version numbers to use as tags from a Dockerfile. The tags are put into a .tags file in the current workspace to be picked up by the drone docker plugin. This program is mainly intended to handle SemVer and may or may not work well with other versioning styles.\n\n### Version type\n\nTo use the program you first need to figure out which `VERSION_TYPE` you want to use. There are four options to choose from. The default or an empty string requires `CUSTOM_TAGS` to be set and just creates a .tags file with the contents of `CUSTOM_TAGS`.\n\n#### date\n\nIf `VERSION_TYPE` is set to `date` a tag will be created corresponding to the current date in format `YEARMONTHDAY` for example `20210101`. If `APP_ENV` is set it will currently be ignored using this `VERSION_TYPE`.\n\n#### docker_env\n\nIf `VERSION_TYPE` is set to `docker_env` then `APP_NAME` is also required. When `docker_env` is used the program looks for the `APP_NAME` version number set as an ENV var in the Dockerfile. The required formating to use in the Dockerfile is:\n\n```\nENV APP_NAME_VERSION VERSION_NUMBER\n```\n\nSo lets say the "APP_NAME" we are looking for is Nginx, then we would set "APP_NAME" to "NGINX" and the ENV var in the Dockerfile would look like this:\n\n```\nENV NGINX_VERSION 1.18.0\n```\n\nThis would generate the following tags:\n\n```\n1,1.18,1.18.0\n```\n\n#### docker_from\n\nIf `VERSION_TYPE` is set to `docker_from` then `APP_NAME` is also required. When using this `VERSION_TYPE` the version number is taken from a `FROM` instruction in the provided Dockerfile. Let\'s say we had the following `FROM` instruction in our Dockerfile:\n\n```\nFROM nginx:1.18.0\n```\n\nWe then set `APP_NAME` to `nginx` and the generated tags would be:\n\n```\n1,1.18,1.18.0\n```\n\n### APP ENV\n\n`APP_ENV` is a static string that will be added to the end of dynamically created tag, so not the ones defined in `CUSTOM_TAGS`. A `-` is added between the generated tag and the contents of `APP_ENV`. Let\'s say we had the version number `1.18.0` and `APP_ENV` was set to `prod` then we would get the following tags:\n\n```\n1-prod,1.18-prod,1.18.0-prod\n```\n\n### INCLUDE_MAJOR\n\n`INCLUDE_MAJOR` determine whether or not the major version number should have a tag of its own. The default for this option is `yes` If the major version number is `0` this option will be ignored and a tag with only the major version number won\'t be created. Let\'s say we had the version number `1.18.0` and `INCLUDE_MAJOR` is set to `no` then we would get the following tags:\n\n```\n1.18,1.18.0\n```\n\n### INCLUDE_SUFFIX\n\n`INCLUDE_SUFFIX` is mainly intended to be used with the `docker_from` version type. It determines whether or not the suffix should be included in the generated tags. The default for this option is `yes`. Let\'s say we had the following `FROM` instruction in our Dockerfile:\n\n```\nFROM nginx:1.18.0-alpine\n```\n\nWith the default of `yes` that would generated the following tags:\n\n```\n1-alpine,1.18-alpine,1.18.0-alpine\n```\n\nAnd if set to `no` the following tags would be generated:\n\n```\n1,1.18,1.18.0\n```\n\n## License\n\nThis program is licensed under the GPLv3 or later.\n',
    'author': 'Magnus Walbeck',
    'author_email': 'magnus.walbeck@walbeck.it',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://git.walbeck.it/walbeck-it/determine-docker-tags',
    'packages': packages,
    'package_data': package_data,
    'entry_points': entry_points,
    'python_requires': '>=3.7,<4.0',
}


setup(**setup_kwargs)
