~roadmr/canonical-identity-provider/fix-deprecation-warnings-1

« back to all changes in this revision

Viewing changes to setup-container

  • Committer: Daniel Manrique
  • Date: 2016-06-14 14:37:24 UTC
  • mto: This revision was merged to the branch mainline in revision 1492.
  • Revision ID: roadmr@ubuntu.com-20160614143724-emjf6yuegmqemjwq
Add setup-container script - update README accordingly

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Do all the necessary magic to prepare and bootstrap the container
 
3
 
 
4
# Barf if not uid 0
 
5
if [ $(id -u) -ne "0" ]; then
 
6
   echo "Please run me with sudo"
 
7
   exit
 
8
fi
 
9
# Barf if not in container, to avoid hosing user's system
 
10
# Note this needs to be run as root (but at this point we should be under
 
11
# sudo anyway).
 
12
if ! grep -qa container=lxc /proc/1/environ; then
 
13
    echo "You're not in an LXC container, so I'm refusing to run."
 
14
    exit
 
15
fi
 
16
 
 
17
# Let's make sure your system is up to date
 
18
apt-get update
 
19
apt-get upgrade -y --force-yes
 
20
# If your host system is not in English, need to fix the locale for
 
21
# the lxc, as the project (and its tests) assume an English machine.
 
22
sed -i 's/LANG=.*/LANG="en_US.UTF-8"/' /etc/default/locale
 
23
# Install software-properties-common for easy addition of PPA
 
24
apt-get install -y software-properties-common
 
25
# Add PPA containing codetree
 
26
apt-add-repository --yes ppa:mojo-maintainers
 
27
# Add PPA containing libsodium
 
28
add-apt-repository --yes ppa:facundo/salty
 
29
apt-get update
 
30
# Install apt dependencies
 
31
cat dependencies.txt dependencies-devel.txt | xargs apt-get install -y --no-install-recommends
 
32
echo All done, now you can do
 
33
echo make bootstrap
 
34
echo make run / make test
 
35