From 363ad0a58affab083f54a5a3b45e0545c54d26a7 Mon Sep 17 00:00:00 2001 From: Vaughn Dice Date: Mon, 26 Nov 2018 15:10:17 -0700 Subject: [PATCH] fix(Makefile/brigade.js): fix the 'command: command not found' instances - switch to `which` for binary detection --- Makefile | 2 +- brigade.js | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index c0a94f3f..d568af88 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ ifeq ($(OS),Windows_NT) else TARGET = $(PROJECT) SHELL ?= bash - CHECK = command -v + CHECK ?= which endif GIT_TAG := $(shell git describe --tags --always) diff --git a/brigade.js b/brigade.js index b36a8fef..fad7c631 100644 --- a/brigade.js +++ b/brigade.js @@ -15,8 +15,8 @@ function build(e, project) { // Set a few environment variables. build.env = { - "DEST_PATH": localPath, - "GOPATH": gopath + DEST_PATH: localPath, + GOPATH: gopath }; // Run Go unit tests @@ -175,8 +175,8 @@ function goDockerBuild(e, p) { goDockerBuild.storage.enabled = true; goDockerBuild.env = { - "DEST_PATH": localPath, - "GOPATH": gopath + DEST_PATH: localPath, + GOPATH: gopath }; goDockerBuild.tasks = [ "cd /src", @@ -199,6 +199,12 @@ function dockerhubPublish(project, tag) { let dockerRegistry = project.secrets.dockerhubRegistry || "docker.io"; let dockerOrg = project.secrets.dockerhubOrg || "deis"; + publisher.env = { + SHELL: "/bin/sh", + DOCKER_REGISTRY: dockerOrg, + VERSION: tag + } + publisher.docker.enabled = true; publisher.storage.enabled = true; publisher.tasks = [ @@ -206,7 +212,7 @@ function dockerhubPublish(project, tag) { `docker login ${dockerRegistry} -u ${project.secrets.dockerhubUsername} -p ${project.secrets.dockerhubPassword}`, "cd /src", "cp -av /mnt/brigade/share/bin ./", - `SHELL=/bin/sh DOCKER_REGISTRY=${dockerOrg} VERSION=${tag} make docker-build docker-push`, + `make docker-build docker-push`, `docker logout ${dockerRegistry}` ];