Merge pull request #9 from kadel/addTravisCI

enable TravisCI
This commit is contained in:
Shubham
2018-01-31 19:15:08 +05:30
committed by GitHub
4 changed files with 37 additions and 2 deletions

16
.travis.yml Normal file
View File

@@ -0,0 +1,16 @@
dist: trusty
sudo: required
language: go
go:
- 1.8
- 1.9
go_import_path: github.com/redhat-developer/ocdev
install:
- make goget-tools
script:
- make
- make validate

View File

@@ -1,4 +1,7 @@
BUILD_FLAGS := -ldflags="-w -X github.com/redhat-developer/ocdev/cmd.GITCOMMIT=$(GITCOMMIT)"
PROJECT := github.com/redhat-developer/ocdev
GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
PKGS := $(shell go list ./... | grep -v $(PROJECT)/vendor)
BUILD_FLAGS := -ldflags="-w -X $(PROJECT)/cmd.GITCOMMIT=$(GITCOMMIT)"
default: bin
@@ -26,3 +29,10 @@ lint:
.PHONY: vet
vet:
go vet $(PKGS)
# install tools used for building, tests and validations
.PHONY: goget-tools
goget-tools:
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/golang/lint/golint

View File

@@ -1,4 +1,7 @@
# ocdev
[![Build Status](https://travis-ci.org/redhat-developer/ocdev.svg?branch=master)](https://travis-ci.org/redhat-developer/ocdev)
## What is ocdev?
OpenShift Command line for Developers
### How to use ocdev as an oc plugin?

View File

@@ -1,4 +1,10 @@
GO_FILES=$(find . -path ./vendor -prune -o -name '*.go' -print )
#!/bin/bash
# Why we are wrapping gofmt?
# - ignore files in vendor direcotry
# - gofmt doesn't exit with error code when there are errors
GO_FILES=$(find . -path ./vendor -prune -o -name '*.go' -print)
for file in $GO_FILES; do
gofmtOutput=$(gofmt -l "$file")