Skip to content

Commit

Permalink
spinner for waiting on CFN stacks
Browse files Browse the repository at this point in the history
  • Loading branch information
cplee committed Mar 8, 2017
1 parent f73fe21 commit bc54aa4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
7 changes: 7 additions & 0 deletions common/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"os"
"strings"
"time"
"github.com/briandowns/spinner"
)

// CreateStackName will create a name for a stack
Expand Down Expand Up @@ -241,6 +242,12 @@ func (cfnMgr *cloudformationStackManager) AwaitFinalStatus(stackName string) *St
params := &cloudformation.DescribeStacksInput{
StackName: aws.String(stackName),
}

// initialize Spinner
spinner := spinner.New(spinner.CharSets[9], 100*time.Millisecond)
spinner.Start()
defer spinner.Stop()

resp, err := cfnAPI.DescribeStacks(params)

if err == nil && resp != nil && len(resp.Stacks) == 1 {
Expand Down
6 changes: 4 additions & 2 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import:
version: ~3.2.0
- package: github.com/tcnksm/go-gitconfig
version: ~0.1.2
- package: github.com/briandowns/spinner
testImport:
- package: github.com/stretchr/testify
version: ~1.1.4
Expand Down
2 changes: 1 addition & 1 deletion workflows/environment_terminate.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (workflow *environmentWorkflow) environmentServiceTerminator(environmentNam
if stack.Tags["environment"] != environmentName {
continue
}
log.Infof(" Undeploying service '%s' from environment '%s'", stack.Tags["service"], environmentName )
log.Infof(" Undeploying service '%s' from environment '%s'", stack.Tags["service"], environmentName)
stackWaiter.AwaitFinalStatus(stack.Name)
}

Expand Down
2 changes: 1 addition & 1 deletion workflows/pipeline_upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"github.com/stelligent/mu/common"
"github.com/stelligent/mu/templates"
"strings"
"regexp"
"strings"
)

// NewPipelineUpserter create a new workflow for upserting a pipeline
Expand Down

0 comments on commit bc54aa4

Please sign in to comment.