Ver código fonte

Fix building the binary on appveyor, and have it create an artifact.

Signed-off-by: Daniel Nephin <[email protected]>
Daniel Nephin 10 anos atrás
pai
commit
d5991761cd
3 arquivos alterados com 20 adições e 6 exclusões
  1. 7 2
      appveyor.yml
  2. 1 1
      script/build-osx
  3. 12 3
      script/build-windows.ps1

+ 7 - 2
appveyor.yml

@@ -1,9 +1,10 @@
 
+version: '{branch}-{build}'
+
 install:
   - "SET PATH=C:\\Python27-x64;C:\\Python27-x64\\Scripts;%PATH%"
   - "python --version"
-  - "pip install tox==2.1.1"
-
+  - "pip install tox==2.1.1 virtualenv==13.1.2"
 
 # Build the binary after tests
 build: false
@@ -13,3 +14,7 @@ test_script:
 
 after_test:
   - ps: ".\\script\\build-windows.ps1"
+
+artifacts:
+  - path: .\dist\docker-compose-Windows-x86_64.exe
+    name: "Compose Windows binary"

+ 1 - 1
script/build-osx

@@ -9,7 +9,7 @@ rm -rf venv
 virtualenv -p /usr/local/bin/python venv
 venv/bin/pip install -r requirements.txt
 venv/bin/pip install -r requirements-build.txt
-venv/bin/pip install .
+venv/bin/pip install --no-deps .
 venv/bin/pyinstaller docker-compose.spec
 mv dist/docker-compose dist/docker-compose-Darwin-x86_64
 dist/docker-compose-Darwin-x86_64 version

+ 12 - 3
script/build-windows.ps1

@@ -13,12 +13,21 @@ Get-ChildItem -Recurse -Include *.pyc | foreach ($_) { Remove-Item $_.FullName }
 virtualenv .\venv
 
 # Install dependencies
-.\venv\Scripts\easy_install "http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download"
+.\venv\Scripts\pip install pypiwin32==219
 .\venv\Scripts\pip install -r requirements.txt
-.\venv\Scripts\pip install -r requirements-build.txt
-.\venv\Scripts\pip install .
+.\venv\Scripts\pip install --no-deps .
+
+# TODO: pip warns when installing from a git sha, so we need to set ErrorAction to
+# 'Continue'.  See
+# https://github.com/pypa/pip/blob/fbc4b7ae5fee00f95bce9ba4b887b22681327bb1/pip/vcs/git.py#L77
+# This can be removed once pyinstaller 3.x is released and we upgrade 
+$ErrorActionPreference = "Continue"
+.\venv\Scripts\pip install --allow-external pyinstaller -r requirements-build.txt
 
 # Build binary
+# pyinstaller has lots of warnings, so we need to run with ErrorAction = Continue
 .\venv\Scripts\pyinstaller .\docker-compose.spec
+$ErrorActionPreference = "Stop"
+
 Move-Item -Force .\dist\docker-compose .\dist\docker-compose-Windows-x86_64.exe
 .\dist\docker-compose-Windows-x86_64.exe --version