refactor(windows): add build screipt
This commit is contained in:
parent
376b1be00d
commit
6a0370ab67
@ -4,38 +4,35 @@ image: 'Visual Studio 2017'
|
|||||||
clone_folder: 'c:\go\src\github.com\appleboy\drone-telegram'
|
clone_folder: 'c:\go\src\github.com\appleboy\drone-telegram'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
GOPATH: c:\go
|
||||||
docker_username:
|
docker_username:
|
||||||
secure: em/TNLUXxG19O/HvbvfJuQ==
|
secure: em/TNLUXxG19O/HvbvfJuQ==
|
||||||
docker_password:
|
docker_password:
|
||||||
secure: Yo9FJJqihaNz5q8T4Jz8tQ==
|
secure: Yo9FJJqihaNz5q8T4Jz8tQ==
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- ps: |
|
- echo %PATH%
|
||||||
docker version
|
- echo %GOPATH%
|
||||||
go version
|
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
|
||||||
|
- go version
|
||||||
|
- go env
|
||||||
|
- docker version
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- ps: |
|
- ps: |
|
||||||
if ( $env:APPVEYOR_REPO_TAG ) {
|
go build .
|
||||||
go build -v -ldflags "-X main.Version=$env:APPVEYOR_REPO_TAG_NAME" -a -o drone-telegram.exe
|
docker pull microsoft/nanoserver:10.0.14393.1884
|
||||||
} else {
|
|
||||||
go build -v -ldflags "-X main.Version=master" -a -o drone-telegram.exe
|
|
||||||
}
|
|
||||||
docker pull microsoft/nanoserver:10.0.14393.1593
|
|
||||||
docker build -f Dockerfile.windows -t appleboy/drone-telegram:windows .
|
docker build -f Dockerfile.windows -t appleboy/drone-telegram:windows .
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- ps: |
|
- ps: |
|
||||||
docker run --rm appleboy/drone-telegram:windows --version
|
docker run --rm appleboy/drone-telegram:windows --version
|
||||||
|
|
||||||
deploy_script:
|
deploy_script:
|
||||||
- ps: |
|
- ps: |
|
||||||
$ErrorActionPreference = 'Stop';
|
docker login --username $env:DOCKER_USERNAME --password $env:DOCKER_PASSWORD
|
||||||
if ( $env:APPVEYOR_PULL_REQUEST_NUMBER ) {
|
docker push appleboy/drone-telegram:windows
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM microsoft/nanoserver:10.0.14393.1593
|
FROM microsoft/nanoserver:10.0.14393.1884
|
||||||
|
|
||||||
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
|
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
|
||||||
org.label-schema.name="Drone Telegram" \
|
org.label-schema.name="Drone Telegram" \
|
||||||
|
Loading…
Reference in New Issue
Block a user