Kannich Workflow
This page describes what happens, when you run a Kannich workflow through kannichw.
- The wrapper script verifies that the docker daemon is running.
- If
KANNICH_DOCKER_PROXY_URLandKANNICH_DOCKER_PROXY_USERNAMEandKANNICH_DOCKER_PROXY_PASSWORDare set, the wrapper script logs in to the docker proxy usingdocker login. - The wrapper script checks if
KANNICH_CACHE_DIRis set.- If it is set but doesn't exist, it is created.
- If it is not set, the wrapper script checks if a docker volume named
kannich-cacheexists.- If it does not exist, the wrapper script creates a docker volume named
kannich-cache.
- If it does not exist, the wrapper script creates a docker volume named
- The wrapper script pulls the docker image given by
KANNICH_IMAGE.- If no docker image is given, the wrapper script uses the default image
derkork/kannich:latest.
- If no docker image is given, the wrapper script uses the default image
- If
KANNICH_BOOTSTRAP_SETTINGS_XMLis not set, the wrapper script tries to loadd the user's Mavensetting.xmlfile intoKANNICH_BOOTSTRAP_SETTINGS_XML, if the file exists. - The wrapper script reads all environment variables into a file
.kannich_current_env. Variables are written as key-value pairs,name=valueseperated by a zero byte. - The wrapper script runs the docker container.
- The directory where the wrapper script is located is mounted into the container at
/workspace. IfKANNICH_PROJECT_DIRis set, the directory indicated byKANNICH_PROJECT_DIRis mounted into the container at/workspace. - If the
-dflag is set (dev mode), the user's local maven repository is mounted into the container at/kannich/dev-repo. - If
KANNICH_CACHE_DIRis set, the directory indicated byKANNICH_CACHE_DIRis mounted into the container at/kannich/cache. Otherwise, the docker volumekannich-cacheis mounted into the container at/kannich/cache.
- The directory where the wrapper script is located is mounted into the container at
- Docker runs the Kannich CLI as entrypoint.
- The Kannich CLI verifies that
.kannichfile.main.ktsexists and exits if not. - The Kannich CLI builds the execution environment by reading
.kannich_current_envand filtering out variables that are not present inkannichenv. Ifkannichenvdoes not exist only variables that start withKANNICH_,CI_,GITHUB_,BUILD_,CIRCLE_,TRAVIS_orBITBUCKET_are used. - The Kannich CLI deletes the
.kannich_current_envfile. - The Kannich CLI sets up the Maven environment.
- If
KANNICH_BOOTSTRAP_SETTINGS_XMLis set, its contents will be used as Mavensettings.xml. Otherwise, the default Maven settings are used. - If started in dev mode, the user's local Maven repository that was mounted before is used as Maven repository.
- If
- The Kannich CLI reads
.kannichfile.main.ktsand resolves external dependencies via Maven. - The Kannich CLI compiles and executes
.kannichfile.main.kts. - Depending on the given command line arguments, the requested tasks are executed.