blob: 5fb185fd6a92050d800c7e2c776de03045e91e5b [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 # Install pbr
Sean Daguecc524062014-10-01 09:06:43 -040033 if use_library_from_git "pbr"; then
34 git_clone_by_name "pbr"
35 setup_lib "pbr"
36 else
Clark Boylan013f52b2014-12-23 16:56:15 -080037 # Always upgrade pbr to latest version as we may have pulled it
38 # in via system packages.
39 pip_install "-U" "pbr"
Sean Daguecc524062014-10-01 09:06:43 -040040 fi
Robert Collinsf553ce22015-06-17 13:52:20 +120041
42 # bring down global requirements
43 git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
44 pip_install $REQUIREMENTS_DIR
Sean Dague0392a102013-07-31 13:07:45 -040045}
46
47# Restore xtrace
48$XTRACE
49
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010050# Tell emacs to use shell-script-mode
51## Local variables:
52## mode: shell-script
53## End: