forked from pangea-project/pangea-tooling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy_in_container.sh
executable file
·41 lines (31 loc) · 1.15 KB
/
deploy_in_container.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
set -ex
SCRIPTDIR=$(readlink -f $(dirname -- "$0"))
export DEBIAN_FRONTEND=noninteractive
export LANG=en_US.UTF-8
echo "LANG=$LANG" >> /etc/profile
echo "LANG=$LANG" >> /etc/environment
# FIXME: reneable
# echo 'Acquire::http { Proxy "http://10.0.3.1:3142"; };' > /etc/apt/apt.conf.d/00cache
echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/00aptitude
echo 'APT::Color "1";' > /etc/apt/apt.conf.d/99color
# Switch to cloudfront for debian
sed -i 's,httpredir.debian.org,deb.debian.org,g' /etc/apt/sources.list
sed -i 's,ftp.debian.org,deb.debian.org,g' /etc/apt/sources.list
i="3"
while [ $i -gt 0 ]; do
apt-get update && break
i=$((i-1))
sleep 60 # sleep a bit to give problem a chance to resolve
done
ESSENTIAL_PACKAGES="rake ruby ruby-dev build-essential zlib1g-dev git-core"
i="5"
while [ $i -gt 0 ]; do
apt-get -y -o APT::Get::force-yes=true -o Debug::pkgProblemResolver=true \
install ${ESSENTIAL_PACKAGES} && break
i=$((i-1))
done
cd $SCRIPTDIR
# Bootstrap rake if rake is not installed
ruby -e "Gem.install('rake') unless Gem::Specification.map(&:name).include? 'rake'"
exec rake -f deploy_in_container.rake deploy_in_container