Skip to content

Commit

Permalink
Merge pull request #29 from ashish-amarnath/makefile-fixes
Browse files Browse the repository at this point in the history
Add building container image to ci
  • Loading branch information
nrb committed Mar 25, 2020
2 parents 8f4b427 + 6b7cd59 commit 5f61c9a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Makefile
Expand Up @@ -13,8 +13,7 @@
# limitations under the License.

# The binary to build (just the basename).
BIN ?= $(wildcard velero-*)

BIN ?= velero-plugin-for-csi

BUILD_IMAGE ?= golang:1.13-stretch

Expand Down Expand Up @@ -53,7 +52,6 @@ _output/bin/$(GOOS)/$(GOARCH)/$(BIN): build-dirs
$(MAKE) shell CMD="-c '\
GOOS=$(GOOS) \
GOARCH=$(GOARCH) \
PKG=$(PKG) \
BIN=$(BIN) \
OUTPUT_DIR=/output/$(GOOS)/$(GOARCH) \
./hack/build.sh'"
Expand Down Expand Up @@ -83,7 +81,7 @@ build-dirs:
@mkdir -p _output/bin/$(GOOS)/$(GOARCH)
@mkdir -p .go/src/$(PKG) .go/pkg .go/bin .go/std/$(GOOS)/$(GOARCH) .go/go-build

container: all
container: all build-dirs
cp Dockerfile _output/bin/$(GOOS)/$(GOARCH)/Dockerfile
docker build -t $(IMAGE) -f _output/bin/$(GOOS)/$(GOARCH)/Dockerfile _output/bin/$(GOOS)/$(GOARCH)

Expand All @@ -106,6 +104,7 @@ test: build-dirs
@$(MAKE) shell CMD="-c 'go test -v -cover ./...'"

ci: verify-modules all test
IMAGE=velero-plugin-for-csi:pr-verify $(MAKE) container

clean:
@echo "cleaning"
Expand Down

0 comments on commit 5f61c9a

Please sign in to comment.