From fdc76c4f08a70cadd5a2a4480b5c79ecf7c8b423 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 19 Dec 2017 09:52:09 +0800 Subject: [PATCH] feat(windows): support windows docker. --- .appveyor.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 489770b..8e50550 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -41,5 +41,23 @@ test_script: deploy_script: - ps: | - docker login --username $env:DOCKER_USERNAME --password $env:DOCKER_PASSWORD - docker push appleboy/drone-telegram:windows + $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 -eq 'true' ) { + $major,$minor,$patch = $env:APPVEYOR_REPO_TAG_NAME.substring(1).split('.') + docker push appleboy/drone-telegram:windows + docker tag appleboy/drone-telegram:windows appleboy/drone-telegram:$major.$minor.$patch-windows + docker push appleboy/drone-telegram:$major.$minor.$patch-windows + docker tag appleboy/drone-telegram:windows appleboy/drone-telegram:$major.$minor-windows + docker push appleboy/drone-telegram:$major.$minor-windows + docker tag appleboy/drone-telegram:windows appleboy/drone-telegram:$major-windows + docker push appleboy/drone-telegram:$major-windows + } else { + if ( $env:APPVEYOR_REPO_BRANCH -eq 'master' ) { + docker push appleboy/drone-telegram:windows + } + } + }