-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (35 loc) · 1.63 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM golang
# Simplify making releases
RUN apt-get update \
&& apt-get install -yq zip bzip2
RUN wget -O github-release.bz2 https://github.com/aktau/github-release/releases/download/v0.6.2/linux-amd64-github-release.tar.bz2 \
&& tar jxvf github-release.bz2 \
&& mv bin/linux/amd64/github-release /usr/local/bin/ \
&& rm github-release.bz2
ENV TARGET desktop
ENV GOPATH /go
ENV USER root
WORKDIR /go/src/github.com/SvenDowideit/${TARGET}
RUN go get github.com/Sirupsen/logrus \
&& go get github.com/urfave/cli \
&& go get github.com/cloudfoundry-incubator/candiedyaml \
&& go get github.com/google/go-github/github \
&& go get golang.org/x/oauth2 \
&& go get github.com/miekg/mmark \
&& go get github.com/blang/semver \
&& go get github.com/kardianos/osext
RUN go get github.com/Shopify/logrus-bugsnag \
&& go get github.com/bugsnag/bugsnag-go \
&& go get github.com/bugsnag/panicwrap \
&& go get github.com/docker/machine \
&& go get github.com/rancher/cli \
&& go get github.com/rancher/go-rancher
ADD . /go/src/github.com/SvenDowideit/${TARGET}
RUN go get -d -v
RUN go test -v ./...
ARG RELEASE_DATE="developer build"
ARG COMMIT_HASH="unknown"
RUN go build -o ${TARGET} -ldflags "-X main.Version=${RELEASE_DATE} -X main.CommitHash=${COMMIT_HASH}" main.go \
&& GOOS=windows GOARCH=amd64 go build -o ${TARGET}.exe -ldflags "-X main.Version=${RELEASE_DATE} -X main.CommitHash=${COMMIT_HASH}" main.go \
&& GOOS=darwin GOARCH=amd64 go build -o ${TARGET}.app -ldflags "-X main.Version=${RELEASE_DATE} -X main.CommitHash=${COMMIT_HASH}" main.go \
&& zip ${TARGET}.zip ${TARGET} ${TARGET}.exe ${TARGET}.app