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 81066cd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sudo: required
language: go
services:
- docker
install: true

jobs:
include:
- stage: test
script: make test
- script: make cbuild
# - stage: push
# script: echo "TODO"
8 changes: 5 additions & 3 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_RUN ?= $(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)'
$(DOCKER_RUN) '$(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_RUN) '$(BUILD)'

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

0 comments on commit 81066cd

Please sign in to comment.