Add AppVeyor build

Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
pull/1/head
Stefan Scherer 7 years ago
parent 35556c81e9
commit ff5fcb964c
No known key found for this signature in database
GPG Key ID: 5966AEAC37E957FA

@ -1,4 +1,5 @@
# whoami for Windows
[![Build status](https://ci.appveyor.com/api/projects/status/bhma7tmx0eje73ao/branch/master?svg=true)](https://ci.appveyor.com/project/StefanScherer/whoami/branch/master)
Simple HTTP docker service that prints it's container ID

@ -0,0 +1,19 @@
version: 1.0.{build}
environment:
DOCKER_USER:
secure: LjNiW/ZWrfVIJn3Mc9foeg==
DOCKER_PASS:
secure: DWlZYy4BAD1B2oovKAqeUQc8N1fNtr78Yd/hwX6AwQrqCHnyC+Tt/SjjzeWEje0P
install:
- choco install -y docker -pre
- choco install -y curl
- curl.exe -s http://whatismijnip.nl
- docker version
build_script:
- ps: .\build.ps1
deploy_script:
- ps: .\deploy.ps1
test: off

@ -0,0 +1,21 @@
$ErrorActionPreference = 'Stop';
$files = ""
Write-Host Starting build
Write-Host Updating base images
docker pull microsoft/windowsservercore
docker pull microsoft/nanoserver
Write-Host Removing old images
$ErrorActionPreference = 'SilentlyContinue';
docker rmi $(docker images --no-trunc --format '{{.Repository}}:{{.Tag}}' | sls -notmatch -pattern '(REPOSITORY|microsoft\/(windowsservercore|nanoserver))')
$ErrorActionPreference = 'Stop';
Write-Host Prune system
docker system prune -f
docker build -t httpbuild -f Dockerfile.build .
docker create --name httpbuild httpbuild
docker cp httpbuild:/code/http.exe tmp
docker build -t whoami .
docker images

@ -0,0 +1,14 @@
$ErrorActionPreference = 'Stop';
if (! (Test-Path Env:\APPVEYOR_REPO_TAG_NAME)) {
Write-Host "No version tag detected. Skip publishing."
exit 0
}
Write-Host Starting deploy
docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS"
docker tag whoami stefanscherer/whoami-windows:$env:APPVEYOR_REPO_TAG_NAME
docker tag whoami stefanscherer/whoami-windows:latest
docker push stefanscherer/whoami-windows:$env:APPVEYOR_REPO_TAG_NAME
docker push stefanscherer/whoami-windows:latest
Loading…
Cancel
Save