This repository has been archived by the owner on Aug 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/rancher/rancher-catalog-service
- Loading branch information
Showing
15 changed files
with
147 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bin | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
image: rancher/dind:v0.6.0 | ||
script: | ||
- ./scripts/ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/bin | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM golang:1.5 | ||
RUN go get github.com/tools/godep | ||
RUN go get github.com/golang/lint/golint | ||
ENV DAPPER_SOURCE /go/src/github.com/rancher/rancher-catalog-service | ||
ENV DAPPER_OUTPUT bin dist | ||
RUN apt-get update && apt-get install -y xz-utils | ||
WORKDIR ${DAPPER_SOURCE} | ||
ENTRYPOINT ["./scripts/entry"] | ||
CMD ["build"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
./scripts/build | ||
./scripts/test | ||
#./scripts/validate | ||
./scripts/package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
. ./scripts/common | ||
|
||
mkdir -p $(dirname $BIN) | ||
echo Building $BIN | ||
godep go build -o $BIN $MAIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
cd $(dirname $0)/.. | ||
if [ ! -x "$(which dapper)" ] ;then | ||
go get github.com/ibuildthecloud/dapper | ||
PATH=$GOPATH/bin:${PATH} | ||
fi | ||
docker version >/dev/null 2>&1 || wrapdocker || docker version | ||
dapper all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BIN=bin/rancher-catalog-service | ||
MAIN=main.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
setpath() | ||
{ | ||
if [ -x "build/dapper/bin/dapper" ]; then | ||
PATH=${PATH}:$(pwd)/build/dapper/bin/dapper | ||
fi | ||
} | ||
|
||
setpath | ||
|
||
if [ ! -x "$(which dapper)" ]; then | ||
( | ||
GOPATH=$(pwd)/build/dapper | ||
mkdir -p $GOPATH | ||
go get github.com/ibuildthecloud/dapper | ||
) | ||
fi | ||
|
||
exec dapper "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ -e ./scripts/$1 ]; then | ||
exec ./scripts/"$@" | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
. ./scripts/common | ||
|
||
mkdir -p dist/artifacts | ||
tar cvJf dist/artifacts/$(basename $BIN).tar.xz -C $(dirname $BIN) . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
godep go test ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
fmt() | ||
{ | ||
local files=$(gofmt -l . | grep -v 'Godeps') | ||
|
||
if [ -n "$files" ]; then | ||
echo Failed gofmt | ||
echo $files | ||
return 1 | ||
fi | ||
} | ||
|
||
lint() | ||
{ | ||
for i in $(find -type d | grep -vE '(Godep|.git)'); do | ||
golint $i | ||
done | ||
} | ||
|
||
vet() | ||
{ | ||
for i in $(find -type d | grep -vE '(Godep|.git|bin|dist|DATA|scripts)'); do | ||
go vet $i | ||
done | ||
} | ||
|
||
fmt || FAILED=1 | ||
lint || FAILED=1 | ||
vet || FAILED=1 | ||
|
||
if [ "$FAILED" = 1 ]; then | ||
echo Checks failed | ||
exit 1 | ||
fi |