Skip to content

Commit

Permalink
Add .travis.yml
Browse files Browse the repository at this point in the history
Signed-off-by: liz <liz@heptio.com>
  • Loading branch information
liztio committed Nov 2, 2017
1 parent b7546ff commit 742d768
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sudo: required
language: go
services:
- docker
install: true

jobs:
include:
- stage: test
script: make test
# - stage: push
# script: echo "TODO"
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,24 @@ KUBECFG_CMD = $(DOCKER) run \
$(KSONNET_BUILD_IMAGE) \
kubecfg show -o yaml -V RBAC_ENABLED=$(RBAC_ENABLED) -J $(WORKDIR) -o yaml $< > $@

DOCKER_BUILD ?= $(DOCKER) run --rm -v $(DIR):$(BUILDMNT) -w $(BUILDMNT) $(BUILD_IMAGE) /bin/sh -c

.PHONY: all container push clean cbuild test local generate

all: container

test:
$(DOCKER) run --rm -v $(DIR):$(BUILDMNT) -w $(BUILDMNT) $(BUILD_IMAGE) /bin/sh -c '$(TEST)'
test: cbuild
$(DOCKER_BUILD) '$(TEST)'

container: cbuild
container: test cbuild
$(DOCKER) build \
-t $(REGISTRY)/$(TARGET):$(IMAGE_VERSION) \
-t $(REGISTRY)/$(TARGET):$(IMAGE_BRANCH) \
-t $(REGISTRY)/$(TARGET):$(GIT_REF) \
.

cbuild:
$(DOCKER) run --rm -v $(DIR):$(BUILDMNT) -w $(BUILDMNT) $(BUILD_IMAGE) /bin/sh -c '$(BUILD) && $(TEST)'
$(DOCKER_BUILD) '$(BUILD)'

push:
$(DOCKER) push $(REGISTRY)/$(TARGET):$(IMAGE_BRANCH)
Expand Down

0 comments on commit 742d768

Please sign in to comment.