windows.ps1 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Builds the Windows binary.
  2. #
  3. # From a fresh 64-bit Windows 10 install, prepare the system as follows:
  4. #
  5. # 1. Install Git:
  6. #
  7. # http://git-scm.com/download/win
  8. #
  9. # 2. Install Python 3.6.4:
  10. #
  11. # https://www.python.org/downloads/
  12. #
  13. # 3. Append ";C:\Python36;C:\Python36\Scripts" to the "Path" environment variable:
  14. #
  15. # https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx?mfr=true
  16. #
  17. # 4. In Powershell, run the following commands:
  18. #
  19. # $ pip install 'virtualenv>=15.1.0'
  20. # $ Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
  21. #
  22. # 5. Clone the repository:
  23. #
  24. # $ git clone https://github.com/docker/compose.git
  25. # $ cd compose
  26. #
  27. # 6. Build the binary:
  28. #
  29. # .\script\build\windows.ps1
  30. $ErrorActionPreference = "Stop"
  31. # Remove virtualenv
  32. if (Test-Path venv) {
  33. Remove-Item -Recurse -Force .\venv
  34. }
  35. # Remove .pyc files
  36. Get-ChildItem -Recurse -Include *.pyc | foreach ($_) { Remove-Item $_.FullName }
  37. # Create virtualenv
  38. virtualenv .\venv
  39. # pip and pyinstaller generate lots of warnings, so we need to ignore them
  40. $ErrorActionPreference = "Continue"
  41. .\venv\Scripts\pip install pypiwin32==223
  42. .\venv\Scripts\pip install -r requirements.txt
  43. .\venv\Scripts\pip install --no-deps .
  44. .\venv\Scripts\pip install -r requirements-build.txt
  45. git rev-parse --short HEAD | out-file -encoding ASCII compose\GITSHA
  46. # Build binary
  47. .\venv\Scripts\pyinstaller .\docker-compose.spec
  48. $ErrorActionPreference = "Stop"
  49. Move-Item -Force .\dist\docker-compose.exe .\dist\docker-compose-Windows-x86_64.exe
  50. .\dist\docker-compose-Windows-x86_64.exe --version