Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Commit d2757e0

Browse files
committed
add release file
1 parent 16a435c commit d2757e0

File tree

7 files changed

+120
-7
lines changed

7 files changed

+120
-7
lines changed

.drone.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ pipeline:
1515
when:
1616
branch: master
1717
event: tag
18-
19-
18+
2019
publish-image:
2120
image: plugins/docker
2221
dockerfile: package/Dockerfile

Dockerfile.dapper

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM ubuntu:16.04
2+
# FROM arm=armhf/ubuntu:16.04
3+
4+
ARG DAPPER_HOST_ARCH
5+
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
6+
7+
RUN apt-get update && \
8+
apt-get install -y gcc ca-certificates git wget curl vim less file && \
9+
rm -f /bin/sh && ln -s /bin/bash /bin/sh
10+
11+
ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \
12+
GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash
13+
14+
RUN wget -O - https://storage.googleapis.com/golang/go1.9.2.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \
15+
go get github.com/rancher/trash && go get github.com/golang/lint/golint
16+
17+
ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \
18+
DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \
19+
DOCKER_URL=DOCKER_URL_${ARCH}
20+
21+
RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker
22+
23+
ENV DAPPER_ENV REPO TAG DRONE_TAG
24+
ENV DAPPER_SOURCE /go/src/github.com/rancher/fluentd/
25+
ENV DAPPER_OUTPUT ./bin ./dist
26+
ENV DAPPER_DOCKER_SOCKET true
27+
ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache
28+
ENV HOME ${DAPPER_SOURCE}
29+
WORKDIR ${DAPPER_SOURCE}
30+
31+
ENTRYPOINT ["./scripts/entry"]
32+
CMD ["ci"]

Makefile

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
1-
ci:
2-
./scripts/ci
1+
TARGETS := $(shell ls scripts)
2+
3+
.dapper:
4+
@echo Downloading dapper
5+
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp
6+
@@chmod +x .dapper.tmp
7+
@./.dapper.tmp -v
8+
@mv .dapper.tmp .dapper
9+
10+
$(TARGETS): .dapper
11+
./.dapper $@
12+
13+
trash: .dapper
14+
./.dapper -m bind trash
15+
16+
trash-keep: .dapper
17+
./.dapper -m bind trash -k
18+
19+
deps: trash
20+
21+
.DEFAULT_GOAL := ci
22+
23+
.PHONY: $(TARGETS)

main.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package main
2+
3+
import (
4+
"os"
5+
6+
"github.com/Sirupsen/logrus"
7+
"github.com/urfave/cli"
8+
)
9+
10+
var VERSION = "v0.0.0-dev"
11+
12+
func main() {
13+
app := cli.NewApp()
14+
app.Name = "fluentd"
15+
app.Version = VERSION
16+
app.Usage = "You need help!"
17+
app.Action = func(c *cli.Context) error {
18+
logrus.Info("I'm a turkey")
19+
return nil
20+
}
21+
22+
app.Run(os.Args)
23+
}

scripts/build

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
#!/bin/bash
1+
#!/bin/bash
2+
set -e
3+
4+
source $(dirname $0)/version
5+
6+
cd $(dirname $0)/..
7+
8+
mkdir -p bin
9+
[ "$(uname)" != "Darwin" ] && LINKFLAGS="-linkmode external -extldflags -static -s"
10+
CGO_ENABLED=0 go build -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/fluentd

scripts/test

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
#!/bin/bash
1+
#!/bin/bash
2+
set -e
3+
4+
cd $(dirname $0)/..
5+
6+
echo Running tests
7+
8+
PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"
9+
10+
[ "${ARCH}" == "amd64" ] && RACE=-race
11+
go test ${RACE} -cover -tags=test ${PACKAGES}

scripts/validate

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
#!/bin/bash
1+
#!/bin/bash
2+
set -e
3+
4+
cd $(dirname $0)/..
5+
6+
echo Running validation
7+
8+
PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')"
9+
10+
echo Running: go vet
11+
go vet ${PACKAGES}
12+
echo Running: golint
13+
for i in ${PACKAGES}; do
14+
if [ -n "$(golint $i | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then
15+
failed=true
16+
fi
17+
done
18+
test -z "$failed"
19+
echo Running: go fmt
20+
test -z "$(go fmt ${PACKAGES} | tee /dev/stderr)"

0 commit comments

Comments
 (0)