version: '{build}' image: 'Visual Studio 2017' platform: x64 clone_folder: 'c:\go\src\github.com\drone-plugins\drone-matrix' max_jobs: 1 environment: DOCKER_USERNAME: secure: '4YzzahbEiMZQJpOCOd1LAw==' DOCKER_PASSWORD: secure: 'VqO/G3Zfslu6zSLdwHKO+Q==' install: - ps: | docker version go version build_script: - ps: | if ( $env:APPVEYOR_REPO_TAG -eq 'false' ) { go build -ldflags "-X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o drone-matrix.exe } else { $version = $env:APPVEYOR_REPO_TAG_NAME.substring(1) go build -ldflags "-X main.version=$version -X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o drone-matrix.exe } docker pull microsoft/nanoserver:10.0.14393.1593 docker build -f Dockerfile.windows -t plugins/matrix:windows . test_script: - ps: | docker run --rm plugins/matrix: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 -eq 'true' ) { $major,$minor,$patch = $env:APPVEYOR_REPO_TAG_NAME.substring(1).split('.') docker push plugins/matrix:windows docker tag plugins/matrix:windows plugins/matrix:$major.$minor.$patch-windows docker push plugins/matrix:$major.$minor.$patch-windows docker tag plugins/matrix:windows plugins/matrix:$major.$minor-windows docker push plugins/matrix:$major.$minor-windows docker tag plugins/matrix:windows plugins/matrix:$major-windows docker push plugins/matrix:$major-windows } else { if ( $env:APPVEYOR_REPO_BRANCH -eq 'master' ) { docker push plugins/matrix:windows } } }