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

50 lines
1.2 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
2022-01-27 16:57:35 +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"
DEFAULT_DOCKER_COMPOSE_NAME = f"{KIWI_ROOT}/data/etc/docker-compose_default.yml"
2022-01-24 16:39:55 +00:00
# special config directory
2022-01-27 16:57:35 +00:00
CONFIG_DIRECTORY_NAME = "config"
2022-01-24 16:39:55 +00:00
# location for auxiliary Dockerfiles
2021-09-28 17:43:12 +00:00
IMAGES_DIRECTORY_NAME = f"{KIWI_ROOT}/data/images"
2022-01-27 16:57:15 +00:00
# prohibited project names
RESERVED_PROJECT_NAMES = [
CONFIG_DIRECTORY_NAME,
]
####################
# DOCKER IMAGE NAMES
# name for auxiliary docker images
2022-01-27 16:57:35 +00:00
LOCAL_IMAGES_NAME = "localhost/kiwi-scp/auxiliary"
DEFAULT_IMAGE_NAME = "alpine:latest"