create-container.sh 1.5 KB
Newer Older
Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/bin/bash

set -e
set -o xtrace

export DEBIAN_FRONTEND=noninteractive

apt-get install -y ca-certificates

echo 'deb http://ftp.debian.org/debian experimental main' > /etc/apt/sources.list.d/experimental.list

apt-get update

apt-get dist-upgrade -y

apt-get install -y --no-remove \
    git-core \
    gitk \
    git-gui \
    subversion \
    curl \
    lvm2 \
    thin-provisioning-tools \
    python-pkg-resources \
    python-virtualenv \
Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
26 27 28 29
    ccache \
    python3-oauth2client \
    xz-utils \
    sudo
Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
30 31 32 33

curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo
chmod a+x /usr/local/bin/repo

Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
34 35
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
36
useradd -m cros-builder
Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
37 38 39
mkdir -p /chromeos /ccache
chown cros-builder:cros-builder /chromeos /ccache

Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
40
AS_USER="sudo -u cros-builder BOARD=amd64-generic PATH=$PATH:$(pwd)/depot_tools USE_CCACHE=1 CCACHE_DIR=/ccache"
Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
41 42 43 44

$AS_USER git config --global user.name 'ChromeOS Build'
$AS_USER git config --global user.email 'foo@example.com'
$AS_USER git config --global color.ui true
Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
45 46

pushd /chromeos
Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
47
$AS_USER repo init -u https://chromium.googlesource.com/chromiumos/manifest.git
Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
48 49 50
#pushd .repo
#git clone https://github.com/robherring/android_manifest.git # -b ${CI_COMMIT_REF_NAME}
#popd
Tomeu Vizoso's avatar
Tomeu Vizoso committed
51
while [ 1 ]; do du -sh .; sleep 10; done &
Tomeu Vizoso's avatar
Tomeu Vizoso committed
52
$AS_USER repo sync --current-branch --force-sync --no-clone-bundle --no-tags -j5
Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
53 54
#$AS_USER cros_sdk -- ./build_packages --board=${BOARD}
#$AS_USER cros_sdk -- ./build_image --board=${BOARD}
Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
55 56
popd

Tomeu Vizoso's avatar
tmp  
Tomeu Vizoso committed
57 58
du -sh /chromeos