Skip to content

Commit

Permalink
makefile: removing version from dir on packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mcuadros committed Oct 2, 2015
1 parent 62ca510 commit 5a787fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ packages: dependencies
for os in $(PKG_OS); do \
for arch in $(PKG_ARCH); do \
cd $(BASE_PATH); \
mkdir -p $(BUILD_PATH)/$(PROJECT)_$(BRANCH)_$${os}_$${arch}; \
mkdir -p $(BUILD_PATH)/$(PROJECT)_$${os}_$${arch}; \
for cmd in $(COMMANDS); do \
GOOS=$${os} GOARCH=$${arch} $(GOCMD) build -ldflags "-X main.version $(BRANCH) -X main.build \"$(BUILD)\"" -o $(BUILD_PATH)/$(PROJECT)_$(BRANCH)_$${os}_$${arch}/$${cmd} $${cmd}.go ; \
GOOS=$${os} GOARCH=$${arch} $(GOCMD) build -ldflags "-X main.version $(BRANCH) -X main.build \"$(BUILD)\"" -o $(BUILD_PATH)/$(PROJECT)_$${os}_$${arch}/$${cmd} $${cmd}.go ; \
done; \
for content in $(PKG_CONTENT); do \
cp -rf $${content} $(BUILD_PATH)/$(PROJECT)_$(BRANCH)_$${os}_$${arch}/; \
cp -rf $${content} $(BUILD_PATH)/$(PROJECT)_$${os}_$${arch}/; \
done; \
cd $(BUILD_PATH) && tar -cvzf $(BUILD_PATH)/$(PROJECT)_$(BRANCH)_$${os}_$${arch}.tar.gz $(PROJECT)_$(BRANCH)_$${os}_$${arch}/; \
cd $(BUILD_PATH) && tar -cvzf $(BUILD_PATH)/$(PROJECT)_$(BRANCH)_$${os}_$${arch}.tar.gz $(PROJECT)_$${os}_$${arch}/; \
done; \
done;

Expand Down
13 changes: 9 additions & 4 deletions middlewares/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"

"github.com/mcuadros/ofelia/core"
"github.com/prometheus/log"

"github.com/op/go-logging"
)
Expand All @@ -21,7 +20,7 @@ func (m *Logger) Run(ctx *core.Context) error {
e := ctx.Execution
j := ctx.Job

log.Info(fmt.Sprintf(
m.logger.Debug(fmt.Sprintf(
"%s - Job started %q - %s",
j.GetName(), e.ID, j.GetCommand(),
))
Expand All @@ -34,10 +33,16 @@ func (m *Logger) Run(ctx *core.Context) error {
errText = ctx.Execution.Error.Error()
}

log.Info(fmt.Sprintf(
msg := fmt.Sprintf(
"%s - Job finished %q in %s, failed: %t, error: %s",
j.GetName(), e.ID, e.Duration, e.Failed, errText,
))
)

if ctx.Execution.Error != nil {
m.logger.Warning(msg)
} else {
m.logger.Notice(msg)
}

return err
}

0 comments on commit 5a787fb

Please sign in to comment.