2020-08-11 12:03:00 +00:00
|
|
|
import os
|
|
|
|
|
2021-10-12 17:06:49 +00:00
|
|
|
#############
|
|
|
|
# REGEX PARTS
|
|
|
|
|
|
|
|
# regex part for a number with no leading zeroes
|
2021-10-20 01:05:32 +00:00
|
|
|
_RE_NUMBER: str = r"(?:0|[1-9][0-9]*)"
|
2021-10-12 17:06:49 +00:00
|
|
|
|
|
|
|
# regex for a semantic version string
|
|
|
|
RE_SEMVER = rf"^{_RE_NUMBER}(?:\.{_RE_NUMBER}(?:\.{_RE_NUMBER})?)?$"
|
|
|
|
|
2021-10-13 00:16:09 +00:00
|
|
|
# regex for a variable name
|
2021-10-12 17:17:28 +00:00
|
|
|
RE_VARNAME = r"^[A-Za-z](?:[A-Za-z0-9\._-]*[A-Za-z0-9])$"
|
2021-10-12 17:06:49 +00:00
|
|
|
|
2020-08-18 10:24:55 +00:00
|
|
|
#############
|
|
|
|
# ENVIRONMENT
|
|
|
|
|
2021-09-28 17:43:12 +00:00
|
|
|
# location of "kiwi_scp" module
|
|
|
|
KIWI_ROOT = os.path.dirname(__file__)
|
2020-08-26 11:56:51 +00:00
|
|
|
# default name of kiwi-scp file
|
2020-08-11 12:03:00 +00:00
|
|
|
KIWI_CONF_NAME = os.getenv('KIWI_CONF_NAME', "kiwi.yml")
|
2021-10-22 15:53:33 +00:00
|
|
|
# default name of compose files
|
|
|
|
COMPOSE_FILE_NAME = "docker-compose.yml"
|
2020-08-18 10:24:55 +00:00
|
|
|
|
|
|
|
############
|
|
|
|
# FILE NAMES
|
|
|
|
|
2020-08-26 11:56:51 +00:00
|
|
|
# text files inside kiwi-scp "src" directory
|
2021-09-28 17:43:12 +00:00
|
|
|
HEADER_KIWI_CONF_NAME = f"{KIWI_ROOT}/data/etc/kiwi_header.yml"
|
|
|
|
DEFAULT_KIWI_CONF_NAME = f"{KIWI_ROOT}/data/etc/kiwi_default.yml"
|
|
|
|
DEFAULT_DOCKER_COMPOSE_NAME = f"{KIWI_ROOT}/data/etc/docker-compose_default.yml"
|
2020-08-18 10:24:55 +00:00
|
|
|
|
|
|
|
# special config directory in projects
|
|
|
|
CONF_DIRECTORY_NAME = 'conf'
|
|
|
|
# location for auxiliary Dockerfiles
|
2021-09-28 17:43:12 +00:00
|
|
|
IMAGES_DIRECTORY_NAME = f"{KIWI_ROOT}/data/images"
|
2020-08-18 10:24:55 +00:00
|
|
|
|
|
|
|
####################
|
|
|
|
# DOCKER IMAGE NAMES
|
|
|
|
|
|
|
|
# name for auxiliary docker images
|
2020-08-26 11:56:51 +00:00
|
|
|
LOCAL_IMAGES_NAME = 'localhost/kiwi-scp/auxiliary'
|
2020-08-18 10:24:55 +00:00
|
|
|
DEFAULT_IMAGE_NAME = 'alpine:latest'
|