This repository has been archived by the owner on Mar 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16a435c
commit d2757e0
Showing
7 changed files
with
120 additions
and
7 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
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,32 @@ | ||
FROM ubuntu:16.04 | ||
# FROM arm=armhf/ubuntu:16.04 | ||
|
||
ARG DAPPER_HOST_ARCH | ||
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y gcc ca-certificates git wget curl vim less file && \ | ||
rm -f /bin/sh && ln -s /bin/bash /bin/sh | ||
|
||
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \ | ||
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash | ||
|
||
RUN wget -O - https://storage.googleapis.com/golang/go1.9.2.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \ | ||
go get github.com/rancher/trash && go get github.com/golang/lint/golint | ||
|
||
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \ | ||
DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \ | ||
DOCKER_URL=DOCKER_URL_${ARCH} | ||
|
||
RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker | ||
|
||
ENV DAPPER_ENV REPO TAG DRONE_TAG | ||
ENV DAPPER_SOURCE /go/src/github.com/rancher/fluentd/ | ||
ENV DAPPER_OUTPUT ./bin ./dist | ||
ENV DAPPER_DOCKER_SOCKET true | ||
ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache | ||
ENV HOME ${DAPPER_SOURCE} | ||
WORKDIR ${DAPPER_SOURCE} | ||
|
||
ENTRYPOINT ["./scripts/entry"] | ||
CMD ["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 |
---|---|---|
@@ -1,2 +1,23 @@ | ||
ci: | ||
./scripts/ci | ||
TARGETS := $(shell ls scripts) | ||
|
||
.dapper: | ||
@echo Downloading dapper | ||
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp | ||
@@chmod +x .dapper.tmp | ||
@./.dapper.tmp -v | ||
@mv .dapper.tmp .dapper | ||
|
||
$(TARGETS): .dapper | ||
./.dapper $@ | ||
|
||
trash: .dapper | ||
./.dapper -m bind trash | ||
|
||
trash-keep: .dapper | ||
./.dapper -m bind trash -k | ||
|
||
deps: trash | ||
|
||
.DEFAULT_GOAL := ci | ||
|
||
.PHONY: $(TARGETS) |
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,23 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/Sirupsen/logrus" | ||
"github.com/urfave/cli" | ||
) | ||
|
||
var VERSION = "v0.0.0-dev" | ||
|
||
func main() { | ||
app := cli.NewApp() | ||
app.Name = "fluentd" | ||
app.Version = VERSION | ||
app.Usage = "You need help!" | ||
app.Action = func(c *cli.Context) error { | ||
logrus.Info("I'm a turkey") | ||
return nil | ||
} | ||
|
||
app.Run(os.Args) | ||
} |
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 |
---|---|---|
@@ -1 +1,10 @@ | ||
#!/bin/bash | ||
#!/bin/bash | ||
set -e | ||
|
||
source $(dirname $0)/version | ||
|
||
cd $(dirname $0)/.. | ||
|
||
mkdir -p bin | ||
[ "$(uname)" != "Darwin" ] && LINKFLAGS="-linkmode external -extldflags -static -s" | ||
CGO_ENABLED=0 go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/fluentd |
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 |
---|---|---|
@@ -1 +1,11 @@ | ||
#!/bin/bash | ||
#!/bin/bash | ||
set -e | ||
|
||
cd $(dirname $0)/.. | ||
|
||
echo Running tests | ||
|
||
PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')" | ||
|
||
[ "${ARCH}" == "amd64" ] && RACE=-race | ||
go test ${RACE} -cover -tags=test ${PACKAGES} |
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 |
---|---|---|
@@ -1 +1,20 @@ | ||
#!/bin/bash | ||
#!/bin/bash | ||
set -e | ||
|
||
cd $(dirname $0)/.. | ||
|
||
echo Running validation | ||
|
||
PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')" | ||
|
||
echo Running: go vet | ||
go vet ${PACKAGES} | ||
echo Running: golint | ||
for i in ${PACKAGES}; do | ||
if [ -n "$(golint $i | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then | ||
failed=true | ||
fi | ||
done | ||
test -z "$failed" | ||
echo Running: go fmt | ||
test -z "$(go fmt ${PACKAGES} | tee /dev/stderr)" |