blobxfer/appveyor.yml

105 строки
3.7 KiB
YAML

version: '{branch}-{build}'
clone_depth: 5
cache:
- '%LOCALAPPDATA%\pip\Cache'
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "64"
TOX_ENV: "py27"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "64"
TOX_ENV: "py35"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"
TOX_ENV: "py36"
BLOBXFER_SAS:
secure: b/A4QFUftPz5dFIU1JTphCV+EfZYW5p7bdgUphoESiRK7t/wiWGhudaDWzI25CA/bfGpHOMW+roeqyKKaYNU6hooXQOLajTmwieKLxdvwXZ+M76PxG301qnQvPW6GlmX9zDYaCE/6jxvxQDfGCJvVw==
BLOBXFER_STORAGE_ACCOUNT:
secure: qbpOW+pGmGfG7DFFC7LozA==
DOCKER_USERNAME:
secure: S8n3Geq7JUkN7ZQKXo8CLg==
DOCKER_PASSWORD:
secure: BcI2Fs6IJeTfPq8cAD4KEQ==
DOCKER_IMAGE_TAG_PREFIX: "alfpark/blobxfer:"
init:
- echo %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%
install:
- pip install --upgrade setuptools wheel
- pip install --upgrade coveralls tox
build: off
test_script:
- tox -e "%TOX_ENV%"
after_test:
- set BLOBXFER_ARTIFACT=blobxfer-%APPVEYOR_REPO_TAG_NAME%-win-amd64.exe
- echo is commit tag %APPVEYOR_REPO_TAG% name %APPVEYOR_REPO_TAG_NAME% artifact %BLOBXFER_ARTIFACT%
- IF "%APPVEYOR_REPO_TAG%"=="true" IF "%PYTHON_VERSION%"=="3.5" (
virtualenv -p "%PYTHON%\\python.exe" pyi &&
pyi\\Scripts\\activate.bat &&
pip install --upgrade pyinstaller &&
pip install -e . &&
pyinstaller -F -n "%BLOBXFER_ARTIFACT%" -p blobxfer:cli --additional-hooks-dir blobxfer --exclude-module future.tests --exclude-module future.backports.test --exclude-module future.moves.test --distpath bin cli\\cli.py &&
pyi\\Scripts\\deactivate.bat &&
appveyor PushArtifact "bin\\%BLOBXFER_ARTIFACT%" &&
bin\\%BLOBXFER_ARTIFACT% upload --remote-path releases/%APPVEYOR_REPO_TAG_NAME% --local-path bin\\%BLOBXFER_ARTIFACT% --strip-components 1 --file-md5 --overwrite
)
- ps: >-
if (!($Env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)) {
Write-Host "Build is from a PR, not creating a Docker image"
return
}
if ($Env:PYTHON_VERSION -eq "3.6") {
$DOCKER_IMAGE_TAG_SUFFIX = $null
if ($Env:APPVEYOR_REPO_TAG -eq "true") {
$DOCKER_IMAGE_TAG_SUFFIX = $Env:APPVEYOR_REPO_TAG_NAME + '-windows'
}
elseif ($Env:APPVEYOR_REPO_BRANCH -eq "master") {
$DOCKER_IMAGE_TAG_SUFFIX = 'latest-windows'
}
elseif ($Env:APPVEYOR_REPO_BRANCH -eq "develop") {
$DOCKER_IMAGE_TAG_SUFFIX = 'develop-windows'
}
if ($DOCKER_IMAGE_TAG_SUFFIX -eq $null) {
Write-Host "Image tag suffix is null, not creating a Docker image"
return
}
$DOCKER_IMAGE_TAG = $Env:DOCKER_IMAGE_TAG_PREFIX + $DOCKER_IMAGE_TAG_SUFFIX
Write-Host "Creating image with tag: $DOCKER_IMAGE_TAG"
Install-Package -Name docker -ProviderName DockerMsftProvider -Verbose -Update -Force
Start-Service docker
docker version
pushd docker\\win
docker build --build-arg GIT_BRANCH=$Env:APPVEYOR_REPO_BRANCH --build-arg GIT_COMMIT=$Env:APPVEYOR_REPO_COMMIT -t $DOCKER_IMAGE_TAG .
docker login -u="$Env:DOCKER_USERNAME" -p="$Env:DOCKER_PASSWORD"
docker push $DOCKER_IMAGE_TAG
popd
}
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
description: 'blobxfer release'
auth_token:
secure: +f4N6Qsv3HvJyii0Bs+8qBx3YS7+7FJUWbFSiAdEIUDubFQnNkJgFnBw0Ew2SLkv
artifact: /.*\.exe/
draft: true
prerelease: true
force_update: true
on:
appveyor_repo_tag: true
PYTHON_VERSION: "3.5"