This repository was archived by the owner on Mar 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +120
-7
lines changed
Expand file tree Collapse file tree 7 files changed +120
-7
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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"]
Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff line change 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) "
You can’t perform that action at this time.
0 commit comments