Sean Dague | 3ed99c0 | 2017-06-20 14:09:30 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # lib/oslo |
| 4 | # |
Sean Dague | 7e41c6c | 2017-06-21 10:55:16 -0400 | [diff] [blame] | 5 | # Functions to install libraries from git |
Sean Dague | 3ed99c0 | 2017-06-20 14:09:30 -0400 | [diff] [blame] | 6 | # |
| 7 | # We need this to handle the fact that projects would like to use |
| 8 | # pre-released versions of oslo libraries. |
| 9 | |
| 10 | # Dependencies: |
| 11 | # |
| 12 | # - ``functions`` file |
| 13 | |
| 14 | # ``stack.sh`` calls the entry points in this order: |
| 15 | # |
Sean Dague | 7e41c6c | 2017-06-21 10:55:16 -0400 | [diff] [blame] | 16 | # - install_libraries |
Sean Dague | 3ed99c0 | 2017-06-20 14:09:30 -0400 | [diff] [blame] | 17 | |
| 18 | # Save trace setting |
Sean Dague | 7e41c6c | 2017-06-21 10:55:16 -0400 | [diff] [blame] | 19 | _XTRACE_LIB_LIBRARIES=$(set +o | grep xtrace) |
Sean Dague | 3ed99c0 | 2017-06-20 14:09:30 -0400 | [diff] [blame] | 20 | set +o xtrace |
| 21 | |
| 22 | |
| 23 | # Defaults |
| 24 | # -------- |
| 25 | GITDIR["automaton"]=$DEST/automaton |
| 26 | GITDIR["castellan"]=$DEST/castellan |
| 27 | GITDIR["cliff"]=$DEST/cliff |
| 28 | GITDIR["cursive"]=$DEST/cursive |
| 29 | GITDIR["debtcollector"]=$DEST/debtcollector |
| 30 | GITDIR["futurist"]=$DEST/futurist |
| 31 | GITDIR["os-client-config"]=$DEST/os-client-config |
| 32 | GITDIR["osc-lib"]=$DEST/osc-lib |
| 33 | GITDIR["oslo.cache"]=$DEST/oslo.cache |
| 34 | GITDIR["oslo.concurrency"]=$DEST/oslo.concurrency |
| 35 | GITDIR["oslo.config"]=$DEST/oslo.config |
| 36 | GITDIR["oslo.context"]=$DEST/oslo.context |
| 37 | GITDIR["oslo.db"]=$DEST/oslo.db |
| 38 | GITDIR["oslo.i18n"]=$DEST/oslo.i18n |
| 39 | GITDIR["oslo.log"]=$DEST/oslo.log |
| 40 | GITDIR["oslo.messaging"]=$DEST/oslo.messaging |
| 41 | GITDIR["oslo.middleware"]=$DEST/oslo.middleware |
| 42 | GITDIR["oslo.policy"]=$DEST/oslo.policy |
| 43 | GITDIR["oslo.privsep"]=$DEST/oslo.privsep |
| 44 | GITDIR["oslo.reports"]=$DEST/oslo.reports |
| 45 | GITDIR["oslo.rootwrap"]=$DEST/oslo.rootwrap |
| 46 | GITDIR["oslo.serialization"]=$DEST/oslo.serialization |
| 47 | GITDIR["oslo.service"]=$DEST/oslo.service |
| 48 | GITDIR["oslo.utils"]=$DEST/oslo.utils |
| 49 | GITDIR["oslo.versionedobjects"]=$DEST/oslo.versionedobjects |
| 50 | GITDIR["oslo.vmware"]=$DEST/oslo.vmware |
| 51 | GITDIR["osprofiler"]=$DEST/osprofiler |
| 52 | GITDIR["pycadf"]=$DEST/pycadf |
| 53 | GITDIR["python-openstacksdk"]=$DEST/python-openstacksdk |
| 54 | GITDIR["stevedore"]=$DEST/stevedore |
| 55 | GITDIR["taskflow"]=$DEST/taskflow |
| 56 | GITDIR["tooz"]=$DEST/tooz |
Sean Dague | 7e41c6c | 2017-06-21 10:55:16 -0400 | [diff] [blame] | 57 | |
| 58 | # Non oslo libraries are welcomed below as well, this prevents |
| 59 | # duplication of this code. |
Sean Dague | 99a6477 | 2017-06-21 10:46:12 -0400 | [diff] [blame] | 60 | GITDIR["os-brick"]=$DEST/os-brick |
Sean Dague | 7e41c6c | 2017-06-21 10:55:16 -0400 | [diff] [blame] | 61 | GITDIR["os-traits"]=$DEST/os-traits |
Sean Dague | 3ed99c0 | 2017-06-20 14:09:30 -0400 | [diff] [blame] | 62 | |
| 63 | # Support entry points installation of console scripts |
| 64 | OSLO_BIN_DIR=$(get_python_exec_prefix) |
| 65 | |
| 66 | |
| 67 | # Functions |
| 68 | # --------- |
| 69 | |
| 70 | function _install_lib_from_source { |
| 71 | local name=$1 |
| 72 | if use_library_from_git "$name"; then |
| 73 | git_clone_by_name "$name" |
| 74 | setup_dev_lib "$name" |
| 75 | fi |
| 76 | } |
| 77 | |
| 78 | # install_oslo - install libraries that oslo needs |
| 79 | function install_oslo { |
| 80 | install_libs |
| 81 | } |
| 82 | |
| 83 | # install_libs() - Install additional libraries that we need and want |
| 84 | # on all environments. Some will only install here if from source, |
| 85 | # others will always install. |
| 86 | function install_libs { |
| 87 | _install_lib_from_source "automaton" |
| 88 | _install_lib_from_source "castellan" |
| 89 | _install_lib_from_source "cliff" |
| 90 | _install_lib_from_source "cursive" |
| 91 | _install_lib_from_source "debtcollector" |
| 92 | _install_lib_from_source "futurist" |
| 93 | _install_lib_from_source "osc-lib" |
| 94 | _install_lib_from_source "os-client-config" |
| 95 | _install_lib_from_source "oslo.cache" |
| 96 | _install_lib_from_source "oslo.concurrency" |
| 97 | _install_lib_from_source "oslo.config" |
| 98 | _install_lib_from_source "oslo.context" |
| 99 | _install_lib_from_source "oslo.db" |
| 100 | _install_lib_from_source "oslo.i18n" |
| 101 | _install_lib_from_source "oslo.log" |
| 102 | _install_lib_from_source "oslo.messaging" |
| 103 | _install_lib_from_source "oslo.middleware" |
| 104 | _install_lib_from_source "oslo.policy" |
| 105 | _install_lib_from_source "oslo.privsep" |
| 106 | _install_lib_from_source "oslo.reports" |
| 107 | _install_lib_from_source "oslo.rootwrap" |
| 108 | _install_lib_from_source "oslo.serialization" |
| 109 | _install_lib_from_source "oslo.service" |
| 110 | _install_lib_from_source "oslo.utils" |
| 111 | _install_lib_from_source "oslo.versionedobjects" |
| 112 | _install_lib_from_source "oslo.vmware" |
| 113 | _install_lib_from_source "osprofiler" |
| 114 | _install_lib_from_source "pycadf" |
| 115 | _install_lib_from_source "python-openstacksdk" |
| 116 | _install_lib_from_source "stevedore" |
| 117 | _install_lib_from_source "taskflow" |
| 118 | _install_lib_from_source "tooz" |
| 119 | # installation of additional libraries |
| 120 | # |
| 121 | # os-traits for nova |
Sean Dague | 99a6477 | 2017-06-21 10:46:12 -0400 | [diff] [blame] | 122 | _install_lib_from_source "os-brick" |
Sean Dague | 7e41c6c | 2017-06-21 10:55:16 -0400 | [diff] [blame] | 123 | _install_lib_from_source "os-traits" |
Kaitlin Farr | ed7dbe5 | 2017-06-19 16:50:38 -0400 | [diff] [blame^] | 124 | # |
| 125 | # python client libraries we might need from git can go here |
| 126 | _install_lib_from_source "python-barbicanclient" |
Sean Dague | 99a6477 | 2017-06-21 10:46:12 -0400 | [diff] [blame] | 127 | |
Sean Dague | 3ed99c0 | 2017-06-20 14:09:30 -0400 | [diff] [blame] | 128 | |
| 129 | # etcd (because tooz does not have a hard dependency on these) |
Sean Dague | 7e41c6c | 2017-06-21 10:55:16 -0400 | [diff] [blame] | 130 | # |
| 131 | # NOTE(sdague): this is currently a work around because tooz |
| 132 | # doesn't pull in etcd3. |
Sean Dague | 3ed99c0 | 2017-06-20 14:09:30 -0400 | [diff] [blame] | 133 | pip_install etcd3 |
| 134 | pip_install etcd3gw |
| 135 | } |
| 136 | |
| 137 | # Restore xtrace |
Sean Dague | 7e41c6c | 2017-06-21 10:55:16 -0400 | [diff] [blame] | 138 | $_XTRACE_LIB_LIBRARIES |
Sean Dague | 3ed99c0 | 2017-06-20 14:09:30 -0400 | [diff] [blame] | 139 | |
| 140 | # Tell emacs to use shell-script-mode |
| 141 | ## Local variables: |
| 142 | ## mode: shell-script |
| 143 | ## End: |