Skip to content

Commit

Permalink
added support for service tail model to deploy/terminate handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
daidokoro committed Jul 23, 2017
1 parent c37e6aa commit f87ef9e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion stacks/clouformation.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package stacks

import (
"fmt"
"github.com/daidokoro/qaz/utils"
"sync"
"time"

"github.com/daidokoro/qaz/utils"

"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudformation"
)
Expand Down Expand Up @@ -59,6 +60,10 @@ func DeployHandler(runstacks map[string]string, stacks map[string]*Stack) {
// status - pending, failed, completed
var status = make(map[string]string)

// kick off tail mechanism
tail = make(chan *TailServiceInput)
go TailService(tail)

for _, stk := range stacks {

if _, ok := runstacks[stk.Name]; !ok && len(runstacks) > 0 {
Expand Down Expand Up @@ -161,6 +166,10 @@ func DeployHandler(runstacks map[string]string, stacks map[string]*Stack) {

// TerminateHandler - Handles terminating stacks in the correct order
func TerminateHandler(runstacks map[string]string, stacks map[string]*Stack) {
// kick off tail mechanism
tail = make(chan *TailServiceInput)
go TailService(tail)

for _, stk := range stacks {
if _, ok := runstacks[stk.Name]; !ok && len(runstacks) > 0 {
Log.Debug(fmt.Sprintf("%s: not in run.stacks, skipping", stk.Name))
Expand Down

0 comments on commit f87ef9e

Please sign in to comment.