Skip to content

Commit

Permalink
improve docker stack deployment command
Browse files Browse the repository at this point in the history
  • Loading branch information
gpproton committed Aug 22, 2023
1 parent 73ddc3e commit a59e2bd
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions alias/docker-stack.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
docker_utils="$(dirname $0)/../docker-utils.sh"
if [ -f "$docker_utils" ]; then
source $docker_utils
fi

# source "$(dirname $0)/../util/docker-utils.sh"
function dsd() {
unset ddir
ddir=${2:-${PWD##*/}}
fn-get-file $ddir $1
(
[ -f $env_file ] && export $(sed '/^#/d' $env_file)
docker stack deploy --prune --compose-file $compose_file $stack
)
stack=${2:-${PWD##*/}}
compose_file=${1:-docker-compose.yaml}
docker stack deploy -c <(echo -e "version: '3.9'"; docker compose -f "$compose_file" config | (sed "/published:/s/\"//g") | (sed "/^name:/d")) "$stack"
unset compose_file stack_name
}

alias dsrm="docker stack rm"
Expand Down

0 comments on commit a59e2bd

Please sign in to comment.