From 6a0370ab675b8260d0c793715568a63c86238230 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 9 Dec 2017 19:09:09 +0800 Subject: [PATCH] refactor(windows): add build screipt --- .appveyor.yml | 39 ++++++++++++++++++--------------------- Dockerfile.windows | 2 +- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index c0aa814..11f7784 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,38 +4,35 @@ image: 'Visual Studio 2017' clone_folder: 'c:\go\src\github.com\appleboy\drone-telegram' environment: + GOPATH: c:\go docker_username: secure: em/TNLUXxG19O/HvbvfJuQ== docker_password: secure: Yo9FJJqihaNz5q8T4Jz8tQ== +branches: + only: + - master + install: - - ps: | - docker version - go version + - echo %PATH% + - echo %GOPATH% + - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% + - go version + - go env + - docker version + build_script: - ps: | - if ( $env:APPVEYOR_REPO_TAG ) { - go build -v -ldflags "-X main.Version=$env:APPVEYOR_REPO_TAG_NAME" -a -o drone-telegram.exe - } else { - go build -v -ldflags "-X main.Version=master" -a -o drone-telegram.exe - } - docker pull microsoft/nanoserver:10.0.14393.1593 + go build . + docker pull microsoft/nanoserver:10.0.14393.1884 docker build -f Dockerfile.windows -t appleboy/drone-telegram:windows . + test_script: - ps: | docker run --rm appleboy/drone-telegram:windows --version + deploy_script: - ps: | - $ErrorActionPreference = 'Stop'; - if ( $env:APPVEYOR_PULL_REQUEST_NUMBER ) { - Write-Host Nothing to deploy. - } else { - docker login --username $env:DOCKER_USERNAME --password $env:DOCKER_PASSWORD - if ( $env:APPVEYOR_REPO_TAG ) { - docker tag appleboy/drone-telegram:windows appleboy/drone-telegram:$env:APPVEYOR_REPO_TAG_NAME-windows - docker push appleboy/drone-telegram:$env:APPVEYOR_REPO_TAG_NAME-windows - } else { - docker push appleboy/drone-telegram:windows - } - } + docker login --username $env:DOCKER_USERNAME --password $env:DOCKER_PASSWORD + docker push appleboy/drone-telegram:windows diff --git a/Dockerfile.windows b/Dockerfile.windows index aab040b..965ffd5 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -1,4 +1,4 @@ -FROM microsoft/nanoserver:10.0.14393.1593 +FROM microsoft/nanoserver:10.0.14393.1884 LABEL maintainer="Bo-Yi Wu " \ org.label-schema.name="Drone Telegram" \