commit
c2721095af
|
@ -8,3 +8,5 @@ install:
|
|||
|
||||
script:
|
||||
- ./hack/test
|
||||
- ./hack/lint
|
||||
- ./hack/validate-vendor
|
||||
|
|
|
@ -94,20 +94,17 @@ func (cr *cacheRecord) Mount() ([]mount.Mount, error) {
|
|||
return nil, errors.Wrapf(err, "failed to mount %s", cr.id)
|
||||
}
|
||||
return m, nil
|
||||
} else {
|
||||
if cr.viewMount == nil { // TODO: handle this better
|
||||
cr.view = generateID()
|
||||
m, err := cr.cm.Snapshotter.View(context.TODO(), cr.view, cr.id)
|
||||
if err != nil {
|
||||
cr.view = ""
|
||||
return nil, errors.Wrapf(err, "failed to mount %s", cr.id)
|
||||
}
|
||||
cr.viewMount = m
|
||||
}
|
||||
return cr.viewMount, nil
|
||||
}
|
||||
|
||||
return nil, errors.New("snapshot mount not implemented")
|
||||
if cr.viewMount == nil { // TODO: handle this better
|
||||
cr.view = generateID()
|
||||
m, err := cr.cm.Snapshotter.View(context.TODO(), cr.view, cr.id)
|
||||
if err != nil {
|
||||
cr.view = ""
|
||||
return nil, errors.Wrapf(err, "failed to mount %s", cr.id)
|
||||
}
|
||||
cr.viewMount = m
|
||||
}
|
||||
return cr.viewMount, nil
|
||||
}
|
||||
|
||||
func (cr *cacheRecord) ID() string {
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"Vendor": true,
|
||||
"Deadline": "8m",
|
||||
|
||||
"DisableAll": true,
|
||||
"Enable": [
|
||||
"gofmt",
|
||||
"goimports",
|
||||
"ineffassign",
|
||||
"vet"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
FROM golang:1.8-alpine
|
||||
RUN apk add --no-cache git
|
||||
RUN go get -u gopkg.in/alecthomas/gometalinter.v1 \
|
||||
&& mv /go/bin/gometalinter.v1 /go/bin/gometalinter \
|
||||
&& gometalinter --install
|
||||
WORKDIR /go/src/github.com/tonistiigi/buildkit_poc
|
||||
COPY . .
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eu -o pipefail -x
|
||||
|
||||
# update this to iidfile after 17.06
|
||||
docker build -t buildkit_poc:lint -f ./hack/dockerfiles/lint.Dockerfile --force-rm .
|
||||
docker run buildkit_poc:lint gometalinter --config=gometalinter.json ./...
|
|
@ -4,4 +4,5 @@ set -eu -o pipefail -x
|
|||
|
||||
# update this to iidfile after 17.06
|
||||
docker build -t buildkit_poc:test -f ./hack/dockerfiles/test.Dockerfile --force-rm .
|
||||
docker run -v /tmp --privileged buildkit_poc:test go test ${TESTFLAGS:--v} ${TESTPKGS:-./...}
|
||||
docker run -v /tmp --privileged buildkit_poc:test go test ${TESTFLAGS:--v} ${TESTPKGS:-./...}
|
||||
docker run buildkit_poc:test go build ./...
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eu -o pipefail -x
|
||||
|
||||
# update this to iidfile after 17.06
|
||||
docker build -t buildkit_poc:vendor -f ./hack/dockerfiles/vendor.Dockerfile --force-rm .
|
||||
diffs="$(docker run buildkit_poc:vendor git status --porcelain -- vendor 2>/dev/null)"
|
||||
if [ "$diffs" ]; then
|
||||
{
|
||||
set +x
|
||||
echo 'The result of vndr differs'
|
||||
echo
|
||||
echo "$diffs"
|
||||
echo
|
||||
echo 'Please vendor your package with github.com/LK4D4/vndr.'
|
||||
echo
|
||||
} >&2
|
||||
false
|
||||
fi
|
||||
echo 'Congratulations! All vendoring changes are done the right way.'
|
|
@ -116,7 +116,6 @@ func (pr *progressReader) Read(ctx context.Context) (*Progress, error) {
|
|||
pr.cond.Wait()
|
||||
}
|
||||
}
|
||||
return nil, errors.Errorf("Read not implemented")
|
||||
}
|
||||
|
||||
func (pr *progressReader) append(pw *progressWriter) {
|
||||
|
|
|
@ -127,5 +127,4 @@ func saveProgress(ctx context.Context, pr ProgressReader, t *trace) error {
|
|||
}
|
||||
t.items = append(t.items, *p)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue