From d8e124adc4a222f41c7ecca3b1848b8aa70775f0 Mon Sep 17 00:00:00 2001 From: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Sun, 15 Nov 2020 13:03:12 +0800 Subject: [PATCH] Tools & Docs: compatible with semantic import versioning --- Dockerfile | 10 +++++----- README.md | 2 +- build.sh | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c8d015..b9aa08b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,10 +15,10 @@ FROM golang:1.15.1-alpine3.12 AS be-builder ENV GO111MODULE on -COPY . /go/src/github.com/HFO4/cloudreve -COPY --from=fe-builder /assets/build/ /go/src/github.com/HFO4/cloudreve/assets/build/ +COPY . /go/src/github.com/cloudreve/Cloudreve/v3 +COPY --from=fe-builder /assets/build/ /go/src/github.com/cloudreve/Cloudreve/v3/assets/build/ -WORKDIR /go/src/github.com/HFO4/cloudreve +WORKDIR /go/src/github.com/cloudreve/Cloudreve/v3 RUN set -ex \ && apk upgrade \ @@ -27,8 +27,8 @@ RUN set -ex \ && export VERSION=$(git describe --tags) \ && (cd && go get github.com/rakyll/statik) \ && statik -src=assets/build/ -include=*.html,*.js,*.json,*.css,*.png,*.svg,*.ico -f \ - && go install -ldflags "-X 'github.com/HFO4/cloudreve/pkg/conf.BackendVersion=${VERSION}' \ - -X 'github.com/HFO4/cloudreve/pkg/conf.LastCommit=${COMMIT_SHA}'\ + && go install -ldflags "-X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.BackendVersion=${VERSION}' \ + -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.LastCommit=${COMMIT_SHA}'\ -w -s" # build final image diff --git a/README.md b/README.md index e897210..4420f66 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ export COMMIT_SHA=$(git rev-parse --short HEAD) export VERSION=$(git describe --tags) # 开始编译 -go build -a -o cloudreve -ldflags " -X 'github.com/HFO4/cloudreve/pkg/conf.BackendVersion=$VERSION' -X 'github.com/HFO4/cloudreve/pkg/conf.LastCommit=$COMMIT_SHA'" +go build -a -o cloudreve -ldflags " -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.BackendVersion=$VERSION' -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.LastCommit=$COMMIT_SHA'" ``` 你也可以使用项目根目录下的`build.sh`快速开始构建: diff --git a/build.sh b/build.sh index ea7e101..dd18f3a 100755 --- a/build.sh +++ b/build.sh @@ -39,7 +39,7 @@ buildAssets () { buildBinary () { cd $REPO - go build -a -o cloudreve -ldflags " -X 'github.com/HFO4/cloudreve/pkg/conf.BackendVersion=$VERSION' -X 'github.com/HFO4/cloudreve/pkg/conf.LastCommit=$COMMIT_SHA'" + go build -a -o cloudreve -ldflags " -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.BackendVersion=$VERSION' -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.LastCommit=$COMMIT_SHA'" } _build() { @@ -61,7 +61,7 @@ _build() { out="release/cloudreve_${COMMIT_SHA}_${os}_${arch}" fi - go build -a -o "${out}" -ldflags " -X 'github.com/HFO4/cloudreve/pkg/conf.BackendVersion=$VERSION' -X 'github.com/HFO4/cloudreve/pkg/conf.LastCommit=$COMMIT_SHA'" + go build -a -o "${out}" -ldflags " -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.BackendVersion=$VERSION' -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.LastCommit=$COMMIT_SHA'" if [ "$os" = "windows" ]; then mv $out release/cloudreve.exe @@ -130,4 +130,4 @@ fi if [ "$RELEASE" = "true" ]; then release -fi \ No newline at end of file +fi