Move all build scripts to script/build

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2016-01-15 16:27:43 -05:00
commit a87d482a3b
11 changed files with 11 additions and 11 deletions

16
script/build/image Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
set -e
if [ -z "$1" ]; then
>&2 echo "First argument must be image tag."
exit 1
fi
TAG=$1
VERSION="$(python setup.py --version)"
./script/write-git-sha
python setup.py sdist
cp dist/docker-compose-$VERSION.tar.gz dist/docker-compose-release.tar.gz
docker build -t docker/compose:$TAG -f Dockerfile.run .

13
script/build/linux Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
set -ex
./script/clean
TAG="docker-compose"
docker build -t "$TAG" . | tail -n 200
docker run \
--rm --entrypoint="script/build/linux-entrypoint" \
-v $(pwd)/dist:/code/dist \
-v $(pwd)/.git:/code/.git \
"$TAG"

15
script/build/linux-entrypoint Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
set -ex
TARGET=dist/docker-compose-$(uname -s)-$(uname -m)
VENV=/code/.tox/py27
mkdir -p `pwd`/dist
chmod 777 `pwd`/dist
$VENV/bin/pip install -q -r requirements-build.txt
./script/write-git-sha
su -c "$VENV/bin/pyinstaller docker-compose.spec" user
mv dist/docker-compose $TARGET
$TARGET version

15
script/build/osx Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
set -ex
PATH="/usr/local/bin:$PATH"
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 --no-deps .
./script/write-git-sha
venv/bin/pyinstaller docker-compose.spec
mv dist/docker-compose dist/docker-compose-Darwin-x86_64
dist/docker-compose-Darwin-x86_64 version

60
script/build/windows.ps1 Normal file
View file

@ -0,0 +1,60 @@
# Builds the Windows binary.
#
# From a fresh 64-bit Windows 10 install, prepare the system as follows:
#
# 1. Install Git:
#
# http://git-scm.com/download/win
#
# 2. Install Python 2.7.10:
#
# https://www.python.org/downloads/
#
# 3. Append ";C:\Python27;C:\Python27\Scripts" to the "Path" environment variable:
#
# https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sysdm_advancd_environmnt_addchange_variable.mspx?mfr=true
#
# 4. In Powershell, run the following commands:
#
# $ pip install virtualenv
# $ Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
#
# 5. Clone the repository:
#
# $ git clone https://github.com/docker/compose.git
# $ cd compose
#
# 6. Build the binary:
#
# .\script\build\windows.ps1
$ErrorActionPreference = "Stop"
# Remove virtualenv
if (Test-Path venv) {
Remove-Item -Recurse -Force .\venv
}
# Remove .pyc files
Get-ChildItem -Recurse -Include *.pyc | foreach ($_) { Remove-Item $_.FullName }
# Create virtualenv
virtualenv .\venv
# pip and pyinstaller generate lots of warnings, so we need to ignore them
$ErrorActionPreference = "Continue"
# Install dependencies
.\venv\Scripts\pip install pypiwin32==219
.\venv\Scripts\pip install -r requirements.txt
.\venv\Scripts\pip install --no-deps .
.\venv\Scripts\pip install --allow-external pyinstaller -r requirements-build.txt
git rev-parse --short HEAD | out-file -encoding ASCII compose\GITSHA
# Build binary
.\venv\Scripts\pyinstaller .\docker-compose.spec
$ErrorActionPreference = "Stop"
Move-Item -Force .\dist\docker-compose.exe .\dist\docker-compose-Windows-x86_64.exe
.\dist\docker-compose-Windows-x86_64.exe --version