| Sean Dague | e263c82 | 2014-12-05 14:25:28 -0500 | [diff] [blame] | 1 | #!/bin/bash | 
 | 2 | # | 
| Sean Dague | 0392a10 | 2013-07-31 13:07:45 -0400 | [diff] [blame] | 3 | # 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 Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 10 | # | 
 | 11 | # - ``functions`` file | 
| Sean Dague | 0392a10 | 2013-07-31 13:07:45 -0400 | [diff] [blame] | 12 |  | 
 | 13 | # ``stack.sh`` calls the entry points in this order: | 
 | 14 | # | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 15 | # - install_infra | 
| Sean Dague | 0392a10 | 2013-07-31 13:07:45 -0400 | [diff] [blame] | 16 |  | 
 | 17 | # Save trace setting | 
 | 18 | XTRACE=$(set +o | grep xtrace) | 
 | 19 | set +o xtrace | 
 | 20 |  | 
 | 21 |  | 
 | 22 | # Defaults | 
 | 23 | # -------- | 
| Sean Dague | cc52406 | 2014-10-01 09:06:43 -0400 | [diff] [blame] | 24 | GITDIR["pbr"]=$DEST/pbr | 
| Sean Dague | 0392a10 | 2013-07-31 13:07:45 -0400 | [diff] [blame] | 25 | REQUIREMENTS_DIR=$DEST/requirements | 
 | 26 |  | 
 | 27 | # Entry Points | 
 | 28 | # ------------ | 
 | 29 |  | 
| Sean Dague | 0392a10 | 2013-07-31 13:07:45 -0400 | [diff] [blame] | 30 | # install_infra() - Collect source and prepare | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 31 | function install_infra { | 
| Sean Dague | 0392a10 | 2013-07-31 13:07:45 -0400 | [diff] [blame] | 32 |     # bring down global requirements | 
 | 33 |     git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH | 
 | 34 |  | 
 | 35 |     # Install pbr | 
| Sean Dague | cc52406 | 2014-10-01 09:06:43 -0400 | [diff] [blame] | 36 |     if use_library_from_git "pbr"; then | 
 | 37 |         git_clone_by_name "pbr" | 
 | 38 |         setup_lib "pbr" | 
 | 39 |     else | 
| Clark Boylan | 013f52b | 2014-12-23 16:56:15 -0800 | [diff] [blame] | 40 |         # Always upgrade pbr to latest version as we may have pulled it | 
 | 41 |         # in via system packages. | 
 | 42 |         pip_install "-U" "pbr" | 
| Sean Dague | cc52406 | 2014-10-01 09:06:43 -0400 | [diff] [blame] | 43 |     fi | 
| Sean Dague | 0392a10 | 2013-07-31 13:07:45 -0400 | [diff] [blame] | 44 | } | 
 | 45 |  | 
 | 46 | # Restore xtrace | 
 | 47 | $XTRACE | 
 | 48 |  | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 49 | # Tell emacs to use shell-script-mode | 
 | 50 | ## Local variables: | 
 | 51 | ## mode: shell-script | 
 | 52 | ## End: |