1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-24 21:52:59 +00:00
kiwi-scp/kiwi_scp/_constants.py

47 lines
1.3 KiB
Python
Raw Normal View History

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
_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
#############
# 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")
# default name of compose files
COMPOSE_FILE_NAME = "docker-compose.yml"
############
# 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"
VERSION_TAG_NAME = f"{KIWI_ROOT}/data/etc/version_tag"
DEFAULT_DOCKER_COMPOSE_NAME = f"{KIWI_ROOT}/data/etc/docker-compose_default.yml"
KIWI_HELP_TEXT_NAME = f"{KIWI_ROOT}/data/etc/kiwi_help.txt"
COMMAND_HELP_TEXT_NAME = f"{KIWI_ROOT}/data/etc/command_help.txt"
# 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"
####################
# DOCKER IMAGE NAMES
# name for auxiliary docker images
2020-08-26 11:56:51 +00:00
LOCAL_IMAGES_NAME = 'localhost/kiwi-scp/auxiliary'
DEFAULT_IMAGE_NAME = 'alpine:latest'