1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-21 20:33: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
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'

View file

@ -1,23 +1,23 @@
Commands for Operation:
up Bring up the whole instance, a project or service(s) inside a project
down Bring down the whole instance, a project or service(s) inside a project
update Update the whole instance, a project or service(s) inside a project
clean Cleanly sync all configs to target folder, then relaunch affected projects
purge Remove all running docker artifacts of this instance
up Bring up the whole instance, a project or service(s) inside a project
down Bring down the whole instance, a project or service(s) inside a project
update Update the whole instance, a project or service(s) inside a project
clean Cleanly sync all configs to target folder, then relaunch affected projects
purge Remove all running docker artifacts of this instance
Commands for Instance Management:
config Create or configure kiwi-config instance
inspect Inspect projects in this instance, services inside a project or service(s) inside a project
cmd Run raw docker-compose command in a project
config Create or configure kiwi-config instance
inspect Inspect projects in this instance, services inside a project or service(s) inside a project
cmd Run raw docker-compose command in a project
Commands for Project and Service Management:
new Create new empty project(s) in this instance
enable Enable project(s) in this instance
disable Disable project(s) in this instance
logs Show logs of a project or service(s) inside a project
shell Spawn shell inside a service inside a project
new Create new empty project(s) in this instance
enable Enable project(s) in this instance
disable Disable project(s) in this instance
logs Show logs of a project or service(s) inside a project
shell Spawn shell inside a service inside a project
Commands for Image Handling:
build Build images for the whole instance, a project or service(s) inside a project
pull Pull images for the whole instance, a project or service(s) inside a project
push Push images for the whole instance, a project or service(s) inside a project
build Build images for the whole instance, a project or service(s) inside a project
pull Pull images for the whole instance, a project or service(s) inside a project
push Push images for the whole instance, a project or service(s) inside a project

View file

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

View file

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