Skip to content

Commit

Permalink
fix: Deploy all may not work (close #67)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Jan 4, 2020
1 parent 541a57f commit 7c813f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ Generate the configuration by merging the default configuration with your worksp

### deploy

`usage: kargo deploy <stack|all>`
`usage: kargo deploy <stack|all> [delay]`

Deploys the specified stack. The stack must be defined in the `STACKS`.

When specifying `all`, it deploys all the stacks. The stacks are deployed in the order defined in the `STACKS` variable.
When specifying `all`, it deploys all the stacks. The stacks are deployed in the order defined in the `STACKS` variable and a `delay` (in seconds) can be specified to wait before deploying each stack. By default the delay is `5` seconds.

### info

Expand Down
7 changes: 5 additions & 2 deletions kargo
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kargo_usage()
printf " %-10s %-25s %s\n" "info" "" "generate the current configuration"
printf " %-10s %-25s %s\n" "build" "<service>" "build the given service"
printf " %-10s %-25s %s\n" "load" "<service>" "load the given service from an archive"
printf " %-10s %-25s %s\n" "deploy" "<stack|all>" "deploy the given stack"
printf " %-10s %-25s %s\n" "deploy" "<stack|all> [delay]" "deploy the given stack"
printf " %-10s %-25s %s\n" "update" "[--force|-f] <stack|all>" "update the given stack"
printf " %-10s %-25s %s\n" "pull" "" "pull the current workspace"
printf " %-10s %-25s %s\n" "remove" "<stack|all>" "remove the given stack"
Expand Down Expand Up @@ -231,9 +231,12 @@ kargo_deploy()
{
kargo_check_stack deploy $1
if [ $1 == 'all' ]; then
local DELAY=${2:-5}
for STACK in $STACKS; do
echo deploying $STACK stack
kargo_deploy $STACK
echo waiting for $DELAY seconds
sleep $DELAY
done
else
# check whether the network exist or not.
Expand Down Expand Up @@ -321,7 +324,7 @@ case $1 in
info) kargo_info;;
build) kargo_build "$2";;
load) kargo_load "$2";;
deploy) kargo_deploy "$2";;
deploy) kargo_deploy "$2" "$3";;
update) kargo_update "$2" "$3";;
remove) kargo_remove "$2";;
*) kargo_usage
Expand Down

0 comments on commit 7c813f1

Please sign in to comment.