From 74f1e6573c98abb42d2b5f39fb5e0ced6a49f078 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 16 Mar 2019 11:46:37 +0800 Subject: [PATCH] feat: support windows build --- .appveyor.yml | 10 ++++++---- docker/Dockerfile.windows | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index a7808f3..6b9303d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -24,14 +24,16 @@ install: build_script: - ps: | if ( $env:APPVEYOR_REPO_TAG -eq 'false' ) { - go build -ldflags "-X main.Version=$env:APPVEYOR_REPO_COMMIT -X main.BuildNum=$env:APPVEYOR_BUILD_VERSION" -a -o release/gorush.exe + $version = $env:APPVEYOR_REPO_COMMIT + $buildDate = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP } else { $version = $env:APPVEYOR_REPO_TAG_NAME - go build -ldflags "-X main.Version=$version -X main.BuildNum=$env:APPVEYOR_BUILD_VERSION" -a -o release/gorush.exe + $buildDate = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP } - dir + go build -ldflags "-X github.com/go-ggz/ggz/version.Version=$version -X github.com/go-ggz/ggz/version.BuildDate=$buildDate" -a -o release/ggz-server.exe . + docker pull microsoft/nanoserver:10.0.14393.1884 - docker build -f Dockerfile.windows -t appleboy/gorush:windows-amd64 . + docker build -f docker/Dockerfile.windows.amd64 -t appleboy/gorush:windows-amd64 . test_script: - ps: | diff --git a/docker/Dockerfile.windows b/docker/Dockerfile.windows index 2220a3e..4c0baf5 100644 --- a/docker/Dockerfile.windows +++ b/docker/Dockerfile.windows @@ -5,10 +5,10 @@ LABEL maintainer="Bo-Yi Wu " \ org.label-schema.vendor="Bo-Yi Wu" \ org.label-schema.schema-version="1.0" -COPY release/gorush.exe /gorush.exe +COPY release/gorush.exe C:/bin/gorush.exe EXPOSE 8088 9000 HEALTHCHECK --start-period=2s --interval=10s --timeout=5s \ CMD ["\\gorush.exe", "--ping"] -ENTRYPOINT [ "\\gorush.exe" ] +ENTRYPOINT [ "C:\\bin\\gorush.exe" ]