| Sean Dague | 0392a10 | 2013-07-31 13:07:45 -0400 | [diff] [blame] | 1 | # 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 Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 8 | # | 
 | 9 | # - ``functions`` file | 
| Sean Dague | 0392a10 | 2013-07-31 13:07:45 -0400 | [diff] [blame] | 10 |  | 
 | 11 | # ``stack.sh`` calls the entry points in this order: | 
 | 12 | # | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 13 | # - unfubar_setuptools | 
 | 14 | # - install_infra | 
| Sean Dague | 0392a10 | 2013-07-31 13:07:45 -0400 | [diff] [blame] | 15 |  | 
 | 16 | # Save trace setting | 
 | 17 | XTRACE=$(set +o | grep xtrace) | 
 | 18 | set +o xtrace | 
 | 19 |  | 
 | 20 |  | 
 | 21 | # Defaults | 
 | 22 | # -------- | 
 | 23 | PBR_DIR=$DEST/pbr | 
 | 24 | REQUIREMENTS_DIR=$DEST/requirements | 
 | 25 |  | 
 | 26 | # Entry Points | 
 | 27 | # ------------ | 
 | 28 |  | 
 | 29 | # unfubar_setuptools() - Unbreak the giant mess that is the current state of setuptools | 
 | 30 | function unfubar_setuptools() { | 
 | 31 |     # 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 | 
 | 43 | function install_infra() { | 
 | 44 |     # 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 Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 55 | # Tell emacs to use shell-script-mode | 
 | 56 | ## Local variables: | 
 | 57 | ## mode: shell-script | 
 | 58 | ## End: |