feat: support windows build

This commit is contained in:
Bo-Yi Wu 2019-03-16 11:46:37 +08:00
parent 9e53ba9917
commit 74f1e6573c
2 changed files with 8 additions and 6 deletions

View File

@ -24,14 +24,16 @@ install:
build_script: build_script:
- ps: | - ps: |
if ( $env:APPVEYOR_REPO_TAG -eq 'false' ) { 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 { } else {
$version = $env:APPVEYOR_REPO_TAG_NAME $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 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: test_script:
- ps: | - ps: |

View File

@ -5,10 +5,10 @@ LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
org.label-schema.vendor="Bo-Yi Wu" \ org.label-schema.vendor="Bo-Yi Wu" \
org.label-schema.schema-version="1.0" org.label-schema.schema-version="1.0"
COPY release/gorush.exe /gorush.exe COPY release/gorush.exe C:/bin/gorush.exe
EXPOSE 8088 9000 EXPOSE 8088 9000
HEALTHCHECK --start-period=2s --interval=10s --timeout=5s \ HEALTHCHECK --start-period=2s --interval=10s --timeout=5s \
CMD ["\\gorush.exe", "--ping"] CMD ["\\gorush.exe", "--ping"]
ENTRYPOINT [ "\\gorush.exe" ] ENTRYPOINT [ "C:\\bin\\gorush.exe" ]