mix(scm&structure):

1. add Fossil scm fix #35
2. move golang/go source to internal dir
pull/43/head
hxzhao527 2018-12-29 14:49:49 +08:00 committed by kun
parent b0865d643c
commit 63c4829b60
5 changed files with 27 additions and 38 deletions

3
.gitignore vendored
View File

@ -4,5 +4,4 @@ cacheDir/*
.idea/*
bin/*
pkg/*
!pkg/proxy
internal/

View File

@ -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"]

View File

@ -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' {} +

View File

@ -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

View File

@ -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