1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-25 05:53:00 +00:00

kiwi help

This commit is contained in:
Jörn-Michael Miehe 2020-08-20 15:29:07 +02:00
parent 6819eabb67
commit 934a1bd15e
7 changed files with 37 additions and 31 deletions

View file

@ -7,12 +7,16 @@ networks:
# interconnects projects # interconnects projects
kiwi_hub: kiwi_hub:
external: external:
name: $KIWI_HUB_NAME name: ${KIWI_HUB_NAME}
services: services:
hello-world: hello-world:
image: alpine:latest image: alpine:latest
command: sh -c 'LOOP=1; while :; do echo Hello World "$$LOOP"; LOOP=$$(($$LOOP + 1)); sleep 10; done' command: sh -c 'LOOP=1; while :; do echo Hello World "$$LOOP"; LOOP=$$(($$LOOP + 1)); sleep 10; done'
networks:
- default
- kiwi_hub
foo-bar: foo-bar:
image: alpine:latest image: alpine:latest
command: sh -c 'LOOP=1; while :; do echo Foo Bar "$$LOOP"; LOOP=$$(($$LOOP + 1)); sleep 20; done' command: sh -c 'LOOP=1; while :; do echo Foo Bar "$$LOOP"; LOOP=$$(($$LOOP + 1)); sleep 20; done'

View file

@ -7,7 +7,7 @@ networks:
# interconnects projects # interconnects projects
kiwi_hub: kiwi_hub:
external: external:
name: $KIWI_HUB_NAME name: ${KIWI_HUB_NAME}
services: services:
# an example service # an example service

9
src/etc/kiwi_help.txt Normal file
View 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

View file

@ -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

View file

@ -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" DEFAULT_KIWI_CONF_NAME = f"{KIWI_ROOT}/etc/kiwi_default.yml"
VERSION_TAG_NAME = f"{KIWI_ROOT}/etc/version_tag" VERSION_TAG_NAME = f"{KIWI_ROOT}/etc/version_tag"
DEFAULT_DOCKER_COMPOSE_NAME = f"{KIWI_ROOT}/etc/docker-compose_default.yml" 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" 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 # special config directory in projects
CONF_DIRECTORY_NAME = 'conf' CONF_DIRECTORY_NAME = 'conf'

View file

@ -2,7 +2,7 @@
import argparse import argparse
# local # local
from ._constants import COMMAND_HELP_TEXT_NAME, USAGE_TEXT_NAME from ._constants import COMMAND_HELP_TEXT_NAME, KIWI_HELP_TEXT_NAME
class Parser: class Parser:
@ -18,16 +18,15 @@ class Parser:
def __init__(self): def __init__(self):
# add version data from separate file (keeps default config cleaner) # 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: with open(COMMAND_HELP_TEXT_NAME, 'r') as stream:
command_help_text = stream.read() command_help_text = stream.read()
with open(USAGE_TEXT_NAME, 'r') as stream:
usage_text = stream.read()
# create main parser # create main parser
self.__parser = argparse.ArgumentParser( self.__parser = argparse.ArgumentParser(
description='kiwi-config', description=kiwi_help,
usage=usage_text,
epilog=command_help_text, epilog=command_help_text,
) )
self.__parser.formatter_class = argparse.RawDescriptionHelpFormatter self.__parser.formatter_class = argparse.RawDescriptionHelpFormatter