Skip to content

Commit

Permalink
add basic building and testing scripts
Browse files Browse the repository at this point in the history
moving to ii/II namespace
  • Loading branch information
Paul Weil authored and Erez Freiberger committed Sep 28, 2016
1 parent 0c4b3e9 commit 98b2d34
Show file tree
Hide file tree
Showing 14 changed files with 586 additions and 237 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/_output
image-inspector
*.a
*.swp
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: go

go:
- 1.5.3
- 1.6

install:
- export PATH=$GOPATH/bin:./_tools/etcd/bin:$PATH
- make install-travis

script:
- make verify test-unit

notifications:
irc: "chat.freenode.net#openshift-dev"

sudo: false
57 changes: 57 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Old-skool build tools.
#
# Targets (see each target for more information):
# all: Build code.
# build: Build code.
# test-unit: Run unit tests.
# clean: Clean up.

OUT_DIR = _output
OUT_PKG_DIR = Godeps/_workspace/pkg

# Build code.
#
# Example:
# make
# make all
all build:
hack/build-go.sh
.PHONY: all build

# Remove all build artifacts.
#
# Example:
# make clean
clean:
rm -rf $(OUT_DIR) $(OUT_PKG_DIR)
.PHONY: clean

# Verify code conventions are properly setup.
#
# Example:
# make verify
verify: build
hack/verify-gofmt.sh
.PHONY: verify

# Run unit tests.
#
# Args:
# WHAT: Directory names to test. All *_test.go files under these
# directories will be run. If not specified, "everything" will be tested.
# TESTS: Same as WHAT.
# GOFLAGS: Extra flags to pass to 'go' when building.
# TESTFLAGS: Extra flags that should only be passed to hack/test-go.sh
#
# Example:
# make test-unit
# make test-unit WHAT=pkg/build GOFLAGS=-v
test-unit:
GOTEST_FLAGS="$(TESTFLAGS)" hack/test-go.sh $(WHAT) $(TESTS)
.PHONY: test-unit

# Install travis dependencies
#
install-travis:
hack/install-tools.sh
.PHONY: install-travis
17 changes: 17 additions & 0 deletions hack/build-go.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# This script sets up a go workspace locally and builds all go components.

set -o errexit
set -o nounset
set -o pipefail

STARTTIME=$(date +%s)
CODE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${CODE_ROOT}/hack/util.sh"
source "${CODE_ROOT}/hack/common.sh"
ii::log::install_errexit

ii::build::build_binaries "$@"

ret=$?; ENDTIME=$(date +%s); echo "$0 took $(($ENDTIME - $STARTTIME)) seconds"; exit "$ret"
Loading

0 comments on commit 98b2d34

Please sign in to comment.