mirror of https://github.com/goproxyio/goproxy
parent
b0865d643c
commit
63c4829b60
|
@ -4,5 +4,4 @@ cacheDir/*
|
|||
.idea/*
|
||||
bin/*
|
||||
|
||||
pkg/*
|
||||
!pkg/proxy
|
||||
internal/
|
||||
|
|
16
Dockerfile
16
Dockerfile
|
@ -1,15 +1,17 @@
|
|||
FROM golang:1.11 AS build
|
||||
|
||||
env GO111MODULE on
|
||||
env GOROOT /usr/local/go
|
||||
|
||||
COPY ./ /goproxy
|
||||
WORKDIR /goproxy
|
||||
RUN go generate
|
||||
RUN go build
|
||||
|
||||
FROM buildpack-deps:stretch-scm
|
||||
RUN cd /goproxy &&\
|
||||
export GO111MODULE=on &&\
|
||||
go generate &&\
|
||||
go mod tidy &&\
|
||||
go build
|
||||
|
||||
FROM alpine:3.8
|
||||
RUN apk add --no-cache git mercurial subversion bzr fossil
|
||||
COPY --from=build /goproxy/goproxy /bin/goproxy
|
||||
|
||||
EXPOSE 8081
|
||||
|
||||
CMD ["goproxy"]
|
|
@ -1,34 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PKG=${PWD}/pkg/
|
||||
PKG=${PWD}/internal
|
||||
GOROOT=`go env GOROOT`
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/base ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/cache ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/cfg ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/dirhash ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/get ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/load ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/modfetch ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/modfile ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/modinfo ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/module ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/search ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/par ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/semver ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/txtar ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/str ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/web ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/web2 ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/work ${PKG}
|
||||
|
||||
mkdir -p ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/go/internal/* ${PKG}
|
||||
|
||||
|
||||
cp -r ${GOROOT}/src/cmd/internal/browser ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/internal/buildid ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/internal/objabi ${PKG}
|
||||
cp -r ${GOROOT}/src/cmd/internal/test2json ${PKG}
|
||||
|
||||
cp -r ${GOROOT}/src/internal/singleflight ${PKG}
|
||||
cp -r ${GOROOT}/src/internal/testenv ${PKG}
|
||||
|
||||
|
||||
find ${PWD}/pkg -type f -name '*.go' -exec sed -i 's/cmd\/go\/internal/github.com\/goproxyio\/goproxy\/pkg/g' {} +
|
||||
find ${PWD}/pkg -type f -name '*.go' -exec sed -i 's/cmd\/internal/github.com\/goproxyio\/goproxy\/pkg/g' {} +
|
||||
find ${PWD}/pkg -type f -name '*.go' -exec sed -i 's/internal/github.com\/goproxyio\/goproxy\/pkg/g' {} +
|
||||
find ${PKG} -type f -name '*.go' -exec sed -i 's/cmd\/go\/internal/github.com\/goproxyio\/goproxy\/internal/g' {} +
|
||||
find ${PKG} -type f -name '*.go' -exec sed -i 's/cmd\/internal/github.com\/goproxyio\/goproxy\/internal/g' {} +
|
||||
find ${PKG} -type f -name '*.go' -exec sed -i 's/internal\/singleflight/github.com\/goproxyio\/goproxy\/internal\/singleflight/g' {} +
|
||||
find ${PKG} -type f -name '*.go' -exec sed -i 's/internal\/testenv/github.com\/goproxyio\/goproxy\/internal\/testenv/g' {} +
|
|
@ -10,10 +10,10 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/goproxyio/goproxy/pkg/cfg"
|
||||
"github.com/goproxyio/goproxy/pkg/modfetch"
|
||||
"github.com/goproxyio/goproxy/pkg/modfetch/codehost"
|
||||
"github.com/goproxyio/goproxy/pkg/module"
|
||||
"github.com/goproxyio/goproxy/internal/cfg"
|
||||
"github.com/goproxyio/goproxy/internal/modfetch"
|
||||
"github.com/goproxyio/goproxy/internal/modfetch/codehost"
|
||||
"github.com/goproxyio/goproxy/internal/module"
|
||||
)
|
||||
|
||||
var cacheDir string
|
||||
|
|
|
@ -15,9 +15,9 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/goproxyio/goproxy/pkg/modfetch"
|
||||
"github.com/goproxyio/goproxy/pkg/module"
|
||||
"github.com/goproxyio/goproxy/pkg/testenv"
|
||||
"github.com/goproxyio/goproxy/internal/modfetch"
|
||||
"github.com/goproxyio/goproxy/internal/module"
|
||||
"github.com/goproxyio/goproxy/internal/testenv"
|
||||
)
|
||||
|
||||
var _handle http.Handler
|
||||
|
|
Loading…
Reference in New Issue