kiwi help
This commit is contained in:
parent
6819eabb67
commit
934a1bd15e
7 changed files with 37 additions and 31 deletions
|
@ -7,12 +7,16 @@ networks:
|
|||
# interconnects projects
|
||||
kiwi_hub:
|
||||
external:
|
||||
name: $KIWI_HUB_NAME
|
||||
name: ${KIWI_HUB_NAME}
|
||||
|
||||
services:
|
||||
hello-world:
|
||||
image: alpine:latest
|
||||
command: sh -c 'LOOP=1; while :; do echo Hello World "$$LOOP"; LOOP=$$(($$LOOP + 1)); sleep 10; done'
|
||||
networks:
|
||||
- default
|
||||
- kiwi_hub
|
||||
|
||||
foo-bar:
|
||||
image: alpine:latest
|
||||
command: sh -c 'LOOP=1; while :; do echo Foo Bar "$$LOOP"; LOOP=$$(($$LOOP + 1)); sleep 20; done'
|
||||
|
|
|
@ -7,7 +7,7 @@ networks:
|
|||
# interconnects projects
|
||||
kiwi_hub:
|
||||
external:
|
||||
name: $KIWI_HUB_NAME
|
||||
name: ${KIWI_HUB_NAME}
|
||||
|
||||
services:
|
||||
# an example service
|
||||
|
|
9
src/etc/kiwi_help.txt
Normal file
9
src/etc/kiwi_help.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
kiwi-config is the tool for container server management.
|
||||
|
||||
Features:
|
||||
- Group your services into projects using their own docker-compose.yml
|
||||
- Bind to file system by using ${TARGETDIR} as volume in docker-compose.yml
|
||||
- Add instance-global config files by using ${CONFDIR} as volume in docker-compose.yml
|
||||
- Add instance-global custom values inside docker-compose.yml using config:runtime:env
|
||||
- Build service-specific, private docker images from Dockerfiles
|
||||
- Check full instances into any version control system
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
%(prog)s {up,down,update,clean,purge} [ARGS...]
|
||||
%(prog)s {config,inspect,cmd} [ARGS...]
|
||||
%(prog)s {new,enable,disable,logs,shell} [ARGS...]
|
||||
%(prog)s {build,pull,push} [ARGS...]
|
||||
%(prog)s -h|--help
|
|
@ -19,8 +19,8 @@ HEADER_KIWI_CONF_NAME = f"{KIWI_ROOT}/etc/kiwi_header.yml"
|
|||
DEFAULT_KIWI_CONF_NAME = f"{KIWI_ROOT}/etc/kiwi_default.yml"
|
||||
VERSION_TAG_NAME = f"{KIWI_ROOT}/etc/version_tag"
|
||||
DEFAULT_DOCKER_COMPOSE_NAME = f"{KIWI_ROOT}/etc/docker-compose_default.yml"
|
||||
KIWI_HELP_TEXT_NAME = f"{KIWI_ROOT}/etc/kiwi_help.txt"
|
||||
COMMAND_HELP_TEXT_NAME = f"{KIWI_ROOT}/etc/command_help.txt"
|
||||
USAGE_TEXT_NAME = f"{KIWI_ROOT}/etc/usage.txt"
|
||||
|
||||
# special config directory in projects
|
||||
CONF_DIRECTORY_NAME = 'conf'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import argparse
|
||||
|
||||
# local
|
||||
from ._constants import COMMAND_HELP_TEXT_NAME, USAGE_TEXT_NAME
|
||||
from ._constants import COMMAND_HELP_TEXT_NAME, KIWI_HELP_TEXT_NAME
|
||||
|
||||
|
||||
class Parser:
|
||||
|
@ -18,16 +18,15 @@ class Parser:
|
|||
|
||||
def __init__(self):
|
||||
# add version data from separate file (keeps default config cleaner)
|
||||
with open(KIWI_HELP_TEXT_NAME, 'r') as stream:
|
||||
kiwi_help = stream.read()
|
||||
|
||||
with open(COMMAND_HELP_TEXT_NAME, 'r') as stream:
|
||||
command_help_text = stream.read()
|
||||
|
||||
with open(USAGE_TEXT_NAME, 'r') as stream:
|
||||
usage_text = stream.read()
|
||||
|
||||
# create main parser
|
||||
self.__parser = argparse.ArgumentParser(
|
||||
description='kiwi-config',
|
||||
usage=usage_text,
|
||||
description=kiwi_help,
|
||||
epilog=command_help_text,
|
||||
)
|
||||
self.__parser.formatter_class = argparse.RawDescriptionHelpFormatter
|
||||
|
|
Loading…
Reference in a new issue