Fixes on deployment

This commit is contained in:
Marc Aymerich 2015-10-03 19:16:50 +00:00
parent 92bb261ec4
commit c28664ae40
2 changed files with 6 additions and 10 deletions

View File

@ -60,10 +60,6 @@ check_root () {
export -f check_root export -f check_root
verlt () {
[ "$1" = "$2" ] && return 1 || verlte $1 $2
}
get_orchestra_dir () { get_orchestra_dir () {
if ! $(echo "import orchestra" | $PYTHON_BIN 2> /dev/null); then if ! $(echo "import orchestra" | $PYTHON_BIN 2> /dev/null); then
echo -e "\norchestra not installed.\n" >&2 echo -e "\norchestra not installed.\n" >&2
@ -139,6 +135,7 @@ function install_requirements () {
git \ git \
iceweasel \ iceweasel \
dnsutils" dnsutils"
fi
run apt-get update run apt-get update
run apt-get install -y $APT run apt-get install -y $APT
@ -174,13 +171,12 @@ function install_requirements () {
# Install a more recent version of wkhtmltopdf (0.12.2) (PDF page number support) # Install a more recent version of wkhtmltopdf (0.12.2) (PDF page number support)
wkhtmltox_version=$(dpkg --list | grep wkhtmltox | awk {'print $3'}) wkhtmltox_version=$(dpkg --list | grep wkhtmltox | awk {'print $3'})
if [[ ! $wkhtmltox_version || verlt $wkhtmltox_version 0.12.2.1 ]]; then minor=$(echo -e "$wkhtmltox_version\n0.12.2.1" | sort -V | head -n 1)
if [[ ! $wkhtmltox_version ]] || [[ $wkhtmltox_version != 0.12.2.1 && $minor == ${wkhtmltox_version} ]]; then
wkhtmltox=$(mktemp) wkhtmltox=$(mktemp)
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb -O ${wkhtmltox} wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-jessie-amd64.deb -O ${wkhtmltox}
dpkg -i ${wkhtmltox} || { echo "Installing missing dependencies for wkhtmltox..." && apt-get -f -y install; } dpkg -i ${wkhtmltox} || { echo "Installing missing dependencies for wkhtmltox..." && apt-get -f -y install; }
fi fi
} }
export -f install_requirements export -f install_requirements
@ -246,5 +242,5 @@ function startproject () {
export -f startproject export -f startproject
[ $# -lt 1 ] && print_help [ $# -lt 1 ] && { print_help; exit 1; }
$1 "${@}" $1 "${@}"

View File

@ -57,11 +57,11 @@ class UNIXUserBackend(ServiceController):
chmod 750 %(base_home)s chmod 750 %(base_home)s
ls -A /etc/skel/ | while read line; do ls -A /etc/skel/ | while read line; do
if [[ ! -e %(home)s/${line} ]]; then if [[ ! -e %(home)s/${line} ]]; then
cp -a $line %(home)s/${line} cp -a $line %(home)s/${line} && \
chown -R %(user)s:%(group)s %(home)s/${line} chown -R %(user)s:%(group)s %(home)s/${line}
fi fi
done done
""") % context fi""") % context
) )
if context['home'] != context['base_home']: if context['home'] != context['base_home']:
self.append(textwrap.dedent(""" self.append(textwrap.dedent("""