blob: 7f70ff2787fba47e3a42382b66e756ea72874ec4 [file] [log] [blame]
Sean Dague0392a102013-07-31 13:07:45 -04001# lib/infra
2#
3# Functions to install infrastructure projects needed by other projects
4# early in the cycle. We need this so we can do things like gate on
5# requirements as a global list
6
7# Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +01008#
9# - ``functions`` file
Sean Dague0392a102013-07-31 13:07:45 -040010
11# ``stack.sh`` calls the entry points in this order:
12#
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010013# - unfubar_setuptools
14# - install_infra
Sean Dague0392a102013-07-31 13:07:45 -040015
16# Save trace setting
17XTRACE=$(set +o | grep xtrace)
18set +o xtrace
19
20
21# Defaults
22# --------
23PBR_DIR=$DEST/pbr
24REQUIREMENTS_DIR=$DEST/requirements
25
26# Entry Points
27# ------------
28
29# unfubar_setuptools() - Unbreak the giant mess that is the current state of setuptools
Ian Wienandaee18c72014-02-21 15:35:08 +110030function unfubar_setuptools {
Sean Dague0392a102013-07-31 13:07:45 -040031 # this is a giant game of who's on first, but it does consistently work
32 # there is hope that upstream python packaging fixes this in the future
33 echo_summary "Unbreaking setuptools"
34 pip_install -U setuptools
35 pip_install -U pip
36 uninstall_package python-setuptools
37 pip_install -U setuptools
38 pip_install -U pip
39}
40
41
42# install_infra() - Collect source and prepare
Ian Wienandaee18c72014-02-21 15:35:08 +110043function install_infra {
Sean Dague0392a102013-07-31 13:07:45 -040044 # bring down global requirements
45 git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
46
47 # Install pbr
48 git_clone $PBR_REPO $PBR_DIR $PBR_BRANCH
49 setup_develop $PBR_DIR
50}
51
52# Restore xtrace
53$XTRACE
54
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010055# Tell emacs to use shell-script-mode
56## Local variables:
57## mode: shell-script
58## End: