~roadmr/checkbox/1311462-remove-n-requirement

« back to all changes in this revision

Viewing changes to support/provision-vagrant

  • Committer: Daniel Manrique
  • Author(s): Daniel Manrique
  • Date: 2014-05-05 20:08:00 UTC
  • mfrom: (2974.1.3 launchpad/test-in-lxc)
  • Revision ID: daniel_manrique-20140505200800-0lteje8dznq04alp
"Added script to perform per-commit testing with LXC. Refactored per-commit testing so tests can be reused with different container technologies, updating existing Vagrant-based testing to the new mechanism.

92ca239 mention LXC in the documentation
cac6972 test-in-lxc.sh: Added script to perform per-commit testing with LXC.
85a1ca7 test-in-vagrant: Use per-component mini-scripts for testing.
f62df14 Extract all per-commit tests to self-contained scripts.
51ea37d provision-vagrant: A few changes to support other container systems. [r=roadmr,zkrynicki][bug=][author=roadmr]"

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# This file is part of Checkbox.
3
 
#
4
 
# Copyright 2013 Canonical Ltd.
5
 
# Written by:
6
 
#   Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
7
 
#
8
 
# Checkbox is free software: you can redistribute it and/or modify
9
 
# it under the terms of the GNU General Public License version 3,
10
 
# as published by the Free Software Foundation.
11
 
 
12
 
#
13
 
# Checkbox is distributed in the hope that it will be useful,
14
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
# GNU General Public License for more details.
17
 
#
18
 
# You should have received a copy of the GNU General Public License
19
 
# along with Checkbox.  If not, see <http://www.gnu.org/licenses/>.
20
 
 
21
 
# Helper script to provision vagrant image 
22
 
# ========================================
23
 
 
24
 
# Set CHECKBOX_TOP for all shared scripts
25
 
export CHECKBOX_TOP=/vagrant 
26
 
 
27
 
# Make sure that dpkg never stops to have a chat with the user
28
 
export DEBIAN_FRONTEND=noninteractive
29
 
 
30
 
# Vagrant sanity check, see if /vagrant really works.
31
 
#
32
 
# On various installations of Ubuntu this is not the case as the cloud images
33
 
# we depend on seem to have broken virtualbox tools installation inside.  This
34
 
# causes the filesystem mounted on /vagrant to crash horribly and kill all
35
 
# processes attempting to use it.
36
 
if ! find /vagrant -mindepth 1 -maxdepth 1 >/dev/null; then
37
 
    cat <<__EOM__
38
 
E: It seems that /vagrant directory is broken
39
 
E: This is a known issue.
40
 
E: See this link for a workaround if you have recent-enough VirtualBox:
41
 
E: https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1252872
42
 
E: Alternatively you can use NFS on any version of VirtualBox:
43
 
E: http://docs.vagrantup.com/v2/synced-folders/nfs.html
44
 
__EOM__
45
 
    exit 1
46
 
else
47
 
    echo "I: it seems that /vagrant is working okay"
48
 
fi
49
 
 
50
 
# Add any necessary PPA repositories
51
 
$CHECKBOX_TOP/support/install-ppa-dependencies
52
 
 
53
 
# Update to have the latest packages, this is needed because the image comes
54
 
# with an old (and no longer working) apt cache and links to many packages no
55
 
# longer work. This is also needed if the step above actually added any PPAs.
56
 
apt-get update
57
 
 
58
 
# Update all packages to latest version
59
 
# NOTE: this is disabled as it takes a lot of time and we haven't found the
60
 
# need to run this. It might have to be re-enabled later if we find that some
61
 
# bug (that gets fixed) is affecting our behavior but so far that has not been
62
 
# the case.
63
 
# apt-get dist-upgrade --yes
64
 
 
65
 
# Ensure that certain Debian dependencies are *not* installed
66
 
$CHECKBOX_TOP/support/remove-deb-anty-dependencies
67
 
 
68
 
set -e
69
 
$CHECKBOX_TOP/support/install-deb-dependencies
70
 
$CHECKBOX_TOP/support/get-external-tarballs
71
 
$CHECKBOX_TOP/support/install-pip-from-source
72
 
# Pip executable name is a variable that depends on python version
73
 
export PIP=/usr/local/bin/pip-3.*
74
 
$CHECKBOX_TOP/support/install-pip-dependencies
75
 
$CHECKBOX_TOP/support/develop-projects
76
 
 
77
 
# Create a cool symlink so that everyone knows where to go to
78
 
ln --no-dereference --force --symbolic /vagrant /home/vagrant/src