blob: c825b4ee5686c8b049f13c89a84cd95f8679371e [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
Sean Dague0392a102013-07-31 13:07:45 -04003# lib/infra
4#
5# Functions to install infrastructure projects needed by other projects
6# early in the cycle. We need this so we can do things like gate on
7# requirements as a global list
8
9# Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010010#
11# - ``functions`` file
Sean Dague0392a102013-07-31 13:07:45 -040012
13# ``stack.sh`` calls the entry points in this order:
14#
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010015# - install_infra
Sean Dague0392a102013-07-31 13:07:45 -040016
17# Save trace setting
18XTRACE=$(set +o | grep xtrace)
19set +o xtrace
20
21
22# Defaults
23# --------
Sean Daguecc524062014-10-01 09:06:43 -040024GITDIR["pbr"]=$DEST/pbr
Sean Dague0392a102013-07-31 13:07:45 -040025REQUIREMENTS_DIR=$DEST/requirements
26
27# Entry Points
28# ------------
29
Sean Dague0392a102013-07-31 13:07:45 -040030# install_infra() - Collect source and prepare
Ian Wienandaee18c72014-02-21 15:35:08 +110031function install_infra {
Sean Dague0392a102013-07-31 13:07:45 -040032 # bring down global requirements
33 git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
34
35 # Install pbr
Sean Daguecc524062014-10-01 09:06:43 -040036 if use_library_from_git "pbr"; then
37 git_clone_by_name "pbr"
38 setup_lib "pbr"
39 else
Clark Boylan013f52b2014-12-23 16:56:15 -080040 # Always upgrade pbr to latest version as we may have pulled it
41 # in via system packages.
42 pip_install "-U" "pbr"
Sean Daguecc524062014-10-01 09:06:43 -040043 fi
Sean Dague0392a102013-07-31 13:07:45 -040044}
45
46# Restore xtrace
47$XTRACE
48
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010049# Tell emacs to use shell-script-mode
50## Local variables:
51## mode: shell-script
52## End: