Skip to content

Commit

Permalink
Merge pull request #24 from concourse/go-mod
Browse files Browse the repository at this point in the history
Migrate to "go mod" + bump dependencies
  • Loading branch information
vito authored Jun 27, 2019
2 parents cf0a4f2 + 2e5c1d5 commit 439cc17
Show file tree
Hide file tree
Showing 618 changed files with 340,535 additions and 46,436 deletions.
9 changes: 7 additions & 2 deletions acceptance/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package acceptance_test

import (
"os"
"strings"
"testing"

"github.com/onsi/gomega/gexec"
Expand All @@ -18,17 +19,21 @@ var (
var _ = BeforeSuite(func() {
var err error

Expect(
strings.Contains(os.Getenv("GOFLAGS"), "-mod=vendor"),
).To(BeTrue(), "GOFLAGS must include `-mod-vendor`")

if _, err = os.Stat("/opt/resource/check"); err == nil {
boshioCheck = "/opt/resource/check"
} else {
boshioCheck, err = gexec.Build("github.com/concourse/bosh-io-stemcell-resource/cmd/check")
boshioCheck, err = gexec.Build("../cmd/check")
Expect(err).NotTo(HaveOccurred())
}

if _, err = os.Stat("/opt/resource/in"); err == nil {
boshioIn = "/opt/resource/in"
} else {
boshioIn, err = gexec.Build("github.com/concourse/bosh-io-stemcell-resource/cmd/in")
boshioIn, err = gexec.Build("../cmd/in")
Expect(err).NotTo(HaveOccurred())
}
})
Expand Down
21 changes: 11 additions & 10 deletions dockerfiles/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
FROM golang:alpine as builder
COPY . /go/src/github.com/concourse/bosh-io-stemcell-resource
COPY . /src
WORKDIR /src
ENV CGO_ENABLED 0
ENV GOPATH /go/src/github.com/concourse/bosh-io-stemcell-resource/Godeps/_workspace:${GOPATH}
ENV PATH /go/src/github.com/concourse/bosh-io-stemcell-resource/Godeps/_workspace/bin:${PATH}
RUN go build -o /assets/out github.com/concourse/bosh-io-stemcell-resource/cmd/out
RUN go build -o /assets/in github.com/concourse/bosh-io-stemcell-resource/cmd/in
RUN go build -o /assets/check github.com/concourse/bosh-io-stemcell-resource/cmd/check
ENV GOFLAGS -mod=vendor
RUN go build -o /assets/out ./cmd/out
RUN go build -o /assets/in ./cmd/in
RUN go build -o /assets/check ./cmd/check
RUN set -e; for pkg in $(go list ./...); do \
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done

FROM alpine:edge AS resource
RUN apk add --update bash tzdata ca-certificates
COPY --from=builder /assets /opt/resource

FROM resource AS tests
ENV GOFLAGS -mod=vendor
COPY --from=builder /tests /tests
RUN set -e; for test in /tests/*.test; do \
$test; \
done
$test; \
done

FROM resource
22 changes: 11 additions & 11 deletions dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
FROM concourse/golang-builder as builder
COPY . /go/src/github.com/concourse/bosh-io-stemcell-resource
COPY . /src
WORKDIR /src
ENV CGO_ENABLED 0
ENV GOPATH /go/src/github.com/concourse/bosh-io-stemcell-resource/Godeps/_workspace:${GOPATH}
ENV PATH /go/src/github.com/concourse/bosh-io-stemcell-resource/Godeps/_workspace/bin:${PATH}
RUN go build -o /assets/out github.com/concourse/bosh-io-stemcell-resource/cmd/out
RUN go build -o /assets/in github.com/concourse/bosh-io-stemcell-resource/cmd/in
RUN go build -o /assets/check github.com/concourse/bosh-io-stemcell-resource/cmd/check
ENV GOFLAGS -mod=vendor
RUN go build -o /assets/out ./cmd/out
RUN go build -o /assets/in ./cmd/in
RUN go build -o /assets/check ./cmd/check
RUN set -e; for pkg in $(go list ./...); do \
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done
go test -o "/tests/$(basename $pkg).test" -c $pkg; \
done

FROM ubuntu:bionic AS resource
RUN apt-get update && apt-get install -y --no-install-recommends \
tzdata \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

COPY --from=builder /assets /opt/resource

FROM resource AS tests
ENV GOFLAGS -mod=vendor
COPY --from=builder /tests /tests
RUN set -e; for test in /tests/*.test; do \
$test; \
done
$test; \
done

FROM resource
20 changes: 20 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module github.com/concourse/bosh-io-stemcell-resource

go 1.12

require (
github.com/blang/semver v3.3.0+incompatible
github.com/fatih/color v1.7.0 // indirect
github.com/golang/protobuf v1.3.1 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/mattn/go-colorable v0.1.2 // indirect
github.com/onsi/ginkgo v1.6.0
github.com/onsi/gomega v1.5.0
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756 // indirect
golang.org/x/text v0.3.2 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.5
gopkg.in/yaml.v2 v2.2.2 // indirect
)
53 changes: 53 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
github.com/blang/semver v3.3.0+incompatible h1:BRtK3PUrMsESEGZwVNZa3sYPGIoNRla1Uhy+oHXiXrE=
github.com/blang/semver v3.3.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756 h1:9nuHUbU8dRnRRfj9KjWUVrJeoexdbeMjttk6Oh1rD10=
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/cheggaaa/pb.v1 v1.0.5 h1:22PAe3AupNuZRZctScXN6sQdv92jWcfQ0tUnekWf4k0=
gopkg.in/cheggaaa/pb.v1 v1.0.5/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
191 changes: 191 additions & 0 deletions vendor/github.com/blang/semver/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 439cc17

Please sign in to comment.