Skip to content

Commit c8a089e

Browse files
committed
Parallel.
1 parent 20d92de commit c8a089e

File tree

1 file changed

+75
-25
lines changed

1 file changed

+75
-25
lines changed

.travis.yml

Lines changed: 75 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,58 +27,108 @@ before_install:
2727
- gcloud config set project technical-tusk
2828

2929
install:
30-
- yes | gcloud compute instances delete travis-instance --zone us-central1-b || true
31-
- gcloud compute instances create travis-instance --zone us-central1-b --image ubuntu-14-04 --machine-type n1-highcpu-32 --boot-disk-size 200 --scopes compute-rw
30+
- yes | gcloud compute instances delete travis-vm --zone us-central1-b || true
31+
- yes | gcloud compute instances delete travis-v2 --zone us-central1-b || true
32+
- gcloud compute instances create travis-vm --zone us-central1-b --image ubuntu-14-04 --machine-type n1-highcpu-16 --boot-disk-size 200 --scopes compute-rw
33+
- gcloud compute instances create travis-v2 --zone us-central1-b --image ubuntu-14-04 --machine-type n1-highcpu-16 --boot-disk-size 200 --scopes compute-rw
3234
- |
3335
while [ 1 ]; do
34-
gcloud compute ssh travis-instance --zone us-central1-b --command 'exit 0' -- -o ConnectTimeout=10 > /dev/null 2>&1 && break
36+
gcloud compute ssh travis-vm --zone us-central1-b --command 'exit 0' -- -o ConnectTimeout=10 > /dev/null 2>&1 && \
37+
gcloud compute ssh travis-v2 --zone us-central1-b --command 'exit 0' -- -o ConnectTimeout=10 > /dev/null 2>&1 && \
38+
break
3539
sleep 1
3640
done
37-
- gcloud compute ssh travis-instance --zone us-central1-b --command 'at now +60 minute -f <(echo "yes | gcloud compute instances delete travis-instance --zone us-central1-b")'
41+
- gcloud compute ssh travis-vm --zone us-central1-b --command 'at now +60 minute -f <(echo "yes | gcloud compute instances delete travis-vm --zone us-central1-b")'
42+
- gcloud compute ssh travis-v2 --zone us-central1-b --command 'at now +60 minute -f <(echo "yes | gcloud compute instances delete travis-v2 --zone us-central1-b")'
3843

3944
script:
4045
- |
41-
rsync -avz -e "$(gcloud compute ssh --zone us-central1-b travis-instance --dry-run | sed s/'[^ ]*$'//)" . "$(gcloud compute ssh --zone us-central1-b travis-instance --dry-run | awk 'END {print $NF}'):~/openwrt-tessel"
42-
- gcloud compute ssh travis-instance --zone us-central1-b --command "echo 'export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID' >> ~/.bashrc; echo 'export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY' >> ~/.bashrc; "
46+
rsync -avz -e "$(gcloud compute ssh --zone us-central1-b travis-vm --dry-run | sed s/'[^ ]*$'//)" . "$(gcloud compute ssh --zone us-central1-b travis-vm --dry-run | awk 'END {print $NF}'):~/openwrt-tessel"
4347
- |
44-
gcloud compute ssh travis-instance --zone us-central1-b --command '
45-
set -e
48+
rsync -avz -e "$(gcloud compute ssh --zone us-central1-b travis-v2 --dry-run | sed s/'[^ ]*$'//)" . "$(gcloud compute ssh --zone us-central1-b travis-v2 --dry-run | awk 'END {print $NF}'):~/openwrt-tessel"
49+
- gcloud compute ssh travis-vm --zone us-central1-b --command "mkdir -p ~/.aws; echo '$AWS_CREDENTIALS' | base64 --decode > ~/.aws/credentials"
50+
- gcloud compute ssh travis-v2 --zone us-central1-b --command "mkdir -p ~/.aws; echo '$AWS_CREDENTIALS' | base64 --decode > ~/.aws/credentials"
51+
- |
52+
gcloud compute ssh travis-vm --zone us-central1-b --command '
4653
set -x
4754
4855
sudo mkdir /tmp/ramdisk
4956
sudo chmod 777 /tmp/ramdisk
50-
sudo mount -t tmpfs -o size=14G tmpfs /tmp/ramdisk/
57+
sudo mount -t tmpfs -o size=12G tmpfs /tmp/ramdisk/
5158
5259
sudo apt-get update -qq
5360
sudo apt-get install -y software-properties-common
5461
sudo apt-add-repository -y ppa:terry.guo/gcc-arm-embedded
5562
sudo apt-get update -qq
5663
sudo apt-get install -y build-essential python-pip git-core g++ subversion libncurses-dev libssl-dev unzip gettext gcc-arm-none-eabi
64+
sudo -H python -m pip install awscli
5765
5866
mkdir ~/upload
5967
cd ~/openwrt-tessel
6068
git submodule update --init --recursive
6169
62-
cp -rf ~/openwrt-tessel /tmp/ramdisk/v2
63-
pushd /tmp/ramdisk/v2
64-
make -j64 || make -j64 || make -j64 || make -j64 || make -j64 V=s
65-
cp /tmp/ramdisk/v2/openwrt/bin/ramips/*sysupgrade.bin ~/upload
66-
tar -czf ~/upload/toolchain-mipsel.tar.gz -C /tmp/ramdisk/v2/openwrt/staging_dir $(find /tmp/ramdisk/v2/openwrt/staging_dir -iname '*-mipsel_*' -exec basename {} \;)
70+
cp -rf ~/openwrt-tessel /tmp/ramdisk/build
71+
pushd /tmp/ramdisk/build
72+
echo "Running mipsel build..."
73+
make -j32 TARGET=v2 >> ~/upload/build-mipsel.log 2>&1 || \
74+
make -j32 TARGET=v2 >> ~/upload/build-mipsel.log 2>&1 || \
75+
make -j32 TARGET=v2 >> ~/upload/build-mipsel.log 2>&1 || \
76+
make -j32 TARGET=v2 V=s >> ~/upload/build-mipsel.log 2>&1 || \
77+
true
78+
aws s3 sync ~/upload/. s3://tessel-builds/firmware/
79+
80+
set -e
81+
cp /tmp/ramdisk/build/openwrt/bin/ramips/*sysupgrade.bin ~/upload
82+
tar -czf ~/upload/toolchain-mipsel.tar.gz -C /tmp/ramdisk/build/openwrt/staging_dir $(find /tmp/ramdisk/build/openwrt/staging_dir -iname '*-mipsel_*' -exec basename {} \;)
6783
popd
6884
69-
rm -rf /tmp/ramdisk/v2
85+
sudo -H python -m pip install awscli
86+
aws s3 sync ~/upload/. s3://tessel-builds/firmware/
87+
' &
88+
PID1=$!
89+
90+
gcloud compute ssh travis-v2 --zone us-central1-b --command '
91+
set -x
92+
93+
sudo mkdir /tmp/ramdisk
94+
sudo chmod 777 /tmp/ramdisk
95+
sudo mount -t tmpfs -o size=12G tmpfs /tmp/ramdisk/
96+
97+
sudo apt-get update -qq
98+
sudo apt-get install -y software-properties-common
99+
sudo apt-add-repository -y ppa:terry.guo/gcc-arm-embedded
100+
sudo apt-get update -qq
101+
sudo apt-get install -y build-essential python-pip git-core g++ subversion libncurses-dev libssl-dev unzip gettext gcc-arm-none-eabi
102+
sudo -H python -m pip install awscli
103+
104+
mkdir ~/upload
105+
cd ~/openwrt-tessel
106+
git submodule update --init --recursive
107+
108+
cp -rf ~/openwrt-tessel /tmp/ramdisk/build
109+
pushd /tmp/ramdisk/build
110+
echo "Running x86 build..."
111+
make -j32 TARGET=vm >> ~/upload/build-x86.log 2>&1 || \
112+
make -j32 TARGET=vm >> ~/upload/build-x86.log 2>&1 || \
113+
make -j32 TARGET=vm >> ~/upload/build-x86.log 2>&1 || \
114+
make -j32 TARGET=vm V=s >> ~/upload/build-x86.log 2>&1 || \
115+
true
116+
aws s3 sync ~/upload/. s3://tessel-builds/firmware/
70117
71-
cp -rf ~/openwrt-tessel /tmp/ramdisk/vm
72-
pushd /tmp/ramdisk/vm
73-
make -j64 TARGET=vm || make -j64 TARGET=vm || make -j64 TARGET=vm || make -j64 TARGET=vm || make -j64 TARGET=vm V=s
74-
cp /tmp/ramdisk/vm/openwrt/bin/x86/*.vdi ~/upload
75-
tar -czf ~/upload/toolchain-x86.tar.gz -C /tmp/ramdisk/vm/openwrt/staging_dir $(find /tmp/ramdisk/vm/openwrt/staging_dir -iname '*-i386_*' -exec basename {} \;)
118+
set -e
119+
cp /tmp/ramdisk/build/openwrt/bin/x86/*.vdi ~/upload
120+
tar -czf ~/upload/toolchain-x86.tar.gz -C /tmp/ramdisk/build/openwrt/staging_dir $(find /tmp/ramdisk/build/openwrt/staging_dir -iname '*-i386_*' -exec basename {} \;)
76121
popd
77122
78-
source ~/.bashrc
79-
sudo -H python -m pip install awscli
80123
aws s3 sync ~/upload/. s3://tessel-builds/firmware/
81-
'
124+
' &
125+
PID2=$!
126+
127+
while kill -0 $PID1 || kill -0 $PID2; do
128+
sleep 10
129+
echo "."
130+
done
82131
83-
after_script:
84-
- yes | gcloud compute instances delete travis-instance --zone us-central1-b || true
132+
# after_script:
133+
# - yes | gcloud compute instances delete travis-v2 --zone us-central1-b || true
134+
# - yes | gcloud compute instances delete travis-vm --zone us-central1-b || true

0 commit comments

Comments
 (0)