diff --git a/dk b/dk index 6c87311..aec3197 100755 --- a/dk +++ b/dk @@ -11,7 +11,8 @@ USAGE COMMANDES build push - run + start, run + stop up logs down @@ -19,7 +20,15 @@ COMMANDES ps ls rm - prune" + prune + +OPTIONS + -d, --chdir PROJDIR + -p, --profile PROFILE + -P, --prod + -T, --test + -j, --no-cache + -n, --fake" } function get_version() { @@ -109,7 +118,7 @@ function default_update_build_env() { function update_build_env() { default_update_build_env; } function default_compose_build() { - docker-compose \ + ${FAKE:+qvals} docker-compose \ "${replace_env_args[@]}" "${env_args[@]}" \ build \ ${NO_CACHE:+--no-cache} \ @@ -121,7 +130,7 @@ function default_docker_build() { for tag in "${TAGS[@]}"; do replace_build_args+=(-t "$NAME:$tag") done - docker build \ + ${FAKE:+qvals} docker build \ ${NO_CACHE:+--no-cache} \ "${replace_env_args[@]}" "${env_args[@]}" \ "${replace_build_args[@]}" "${build_args[@]}" \ @@ -160,18 +169,18 @@ function auto_push() { update_build_env fi for tag in "${TAGS[@]}"; do - docker push "$NAME:$tag" + ${FAKE:+qvals} docker push "$NAME:$tag" done } function default_compose_up() { - docker-compose \ + ${FAKE:+qvals} docker-compose \ "${replace_env_args[@]}" "${env_args[@]}" \ up "${replace_run_args[@]}" "${run_args[@]}" \ "${replace_user_args[@]}" "${user_args[@]}" "$@" } function default_docker_up() { - docker run \ + ${FAKE:+qvals} docker run \ "${replace_env_args[@]}" "${env_args[@]}" \ "${replace_run_args[@]}" "${run_args[@]}" \ "$NAME" \ @@ -196,13 +205,13 @@ function auto_up() { } function default_compose_stop() { - docker-compose \ + ${FAKE:+qvals} docker-compose \ "${replace_env_args[@]}" "${env_args[@]}" \ stop "${replace_stop_args[@]}" "${stop_args[@]}" \ "$@" } function default_docker_stop() { - docker container stop \ + ${FAKE:+qvals} docker container stop \ "${replace_stop_args[@]}" "${stop_args[@]}" \ "$name" "$@" } @@ -222,13 +231,13 @@ function auto_stop() { } function default_compose_logs() { - docker-compose \ + ${FAKE:+qvals} docker-compose \ "${replace_env_args[@]}" "${env_args[@]}" \ logs "${replace_logs_args[@]}" "${logs_args[@]}" \ "$@" } function default_docker_logs() { - docker logs \ + ${FAKE:+qvals} docker logs \ "${replace_logs_args[@]}" "${logs_args[@]}" \ "$name" "$@" } @@ -250,18 +259,18 @@ function auto_logs() { } function default_compose_down() { - docker-compose \ + ${FAKE:+qvals} docker-compose \ "${replace_env_args[@]}" "${env_args[@]}" \ down "${replace_down_args[@]}" "${down_args[@]}" \ "$@" } function default_docker_down() { estep "stop" - docker container stop \ + ${FAKE:+qvals} docker container stop \ "${replace_down_args[@]}" "${down_args[@]}" \ "$name" "$@" estep "rm" - docker container rm \ + ${FAKE:+qvals} docker container rm \ "${replace_rm_args[@]}" "${rm_args[@]}" \ "$name" } @@ -300,6 +309,7 @@ fi chdir= NO_CACHE= +FAKE= args=( --help '$exit_with display_help' -d:,--chdir: chdir= @@ -307,6 +317,7 @@ args=( -P,--prod PROFILE=prod -T,--test PROFILE=test -j,--no-cache NO_CACHE=1 + -n,--fake FAKE=1 ) parse_args "$@"; set -- "${args[@]}"