fix
This commit is contained in:
parent
a4fce30857
commit
4f150fbf18
1
.github/workflows/docker_build_pre.yml
vendored
1
.github/workflows/docker_build_pre.yml
vendored
@ -51,6 +51,7 @@ jobs:
|
|||||||
- name: Build and push Docker images
|
- name: Build and push Docker images
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
|
build-args: VERSION=${{ env.VERSION }}
|
||||||
context: .
|
context: .
|
||||||
file: ./DockerfileGithubAction
|
file: ./DockerfileGithubAction
|
||||||
platforms: |
|
platforms: |
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
FROM golang:alpine as serverbuild
|
FROM golang:alpine as serverbuild
|
||||||
|
ARG VERSION
|
||||||
WORKDIR /work
|
WORKDIR /work
|
||||||
|
|
||||||
COPY server .
|
COPY server .
|
||||||
|
|
||||||
RUN apk update && apk add git
|
RUN apk update && apk add git
|
||||||
RUN go build -ldflags "-s -w -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail main.go
|
RUN go build -ldflags "-s -w -X 'main.version=${VERSION}' -X 'main.goVersion=$(go version)' -X 'main.gitHash=$(git show -s --format=%H)' -X 'main.buildTime=$(TZ=UTC-8 date +%Y-%m-%d" "%H:%M:%S)'" -o pmail main.go
|
||||||
RUN cd /work/hooks/telegram_push && go build -ldflags "-s -w" -o output/telegram_push telegram_push.go
|
RUN cd /work/hooks/telegram_push && go build -ldflags "-s -w" -o output/telegram_push telegram_push.go
|
||||||
RUN cd /work/hooks/web_push && go build -ldflags "-s -w" -o output/web_push web_push.go
|
RUN cd /work/hooks/web_push && go build -ldflags "-s -w" -o output/web_push web_push.go
|
||||||
RUN cd /work/hooks/wechat_push && go build -ldflags "-s -w" -o output/wechat_push wechat_push.go
|
RUN cd /work/hooks/wechat_push && go build -ldflags "-s -w" -o output/wechat_push wechat_push.go
|
||||||
@ -24,8 +24,8 @@ RUN apk add --no-cache tzdata \
|
|||||||
|
|
||||||
|
|
||||||
COPY --from=serverbuild /work/pmail .
|
COPY --from=serverbuild /work/pmail .
|
||||||
COPY --from=serverbuild /work/hooks/telegram_push/output/* ./plugin/
|
COPY --from=serverbuild /work/hooks/telegram_push/output/* ./plugins/
|
||||||
COPY --from=serverbuild /work/hooks/web_push/output/* ./plugin/
|
COPY --from=serverbuild /work/hooks/web_push/output/* ./plugins/
|
||||||
COPY --from=serverbuild /work/hooks/wechat_push/output/* ./plugin/
|
COPY --from=serverbuild /work/hooks/wechat_push/output/* ./plugins/
|
||||||
|
|
||||||
CMD /work/pmail
|
CMD /work/pmail
|
||||||
|
|||||||
@ -41,8 +41,6 @@ type Config struct {
|
|||||||
//go:embed tables/*
|
//go:embed tables/*
|
||||||
var tableConfig embed.FS
|
var tableConfig embed.FS
|
||||||
|
|
||||||
const Version = "2.4.0"
|
|
||||||
|
|
||||||
const DBTypeMySQL = "mysql"
|
const DBTypeMySQL = "mysql"
|
||||||
const DBTypeSQLite = "sqlite"
|
const DBTypeSQLite = "sqlite"
|
||||||
const SSLTypeAuto = "0" //自动生成证书
|
const SSLTypeAuto = "0" //自动生成证书
|
||||||
|
|||||||
@ -74,6 +74,10 @@ func main() {
|
|||||||
log.SetLevel(log.InfoLevel)
|
log.SetLevel(log.InfoLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if version == "" {
|
||||||
|
version = "2.4.0"
|
||||||
|
}
|
||||||
|
|
||||||
log.Infoln("***************************************************")
|
log.Infoln("***************************************************")
|
||||||
log.Infof("***\tServer Start Success Version:%s\n", version)
|
log.Infof("***\tServer Start Success Version:%s\n", version)
|
||||||
log.Infof("***\tGit Commit Hash: %s ", gitHash)
|
log.Infof("***\tGit Commit Hash: %s ", gitHash)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user