Add DevStack module to install tsconfig

The first of a number of anticipated bits...

Change-Id: I829ca465ce3001542bba240955af7ffb0c824a8b
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
This commit is contained in:
Dean Troyer 2018-10-15 17:17:35 -05:00
parent e41465e317
commit 5818ed5216
4 changed files with 128 additions and 0 deletions

66
devstack/lib/stx-update Normal file
View File

@ -0,0 +1,66 @@
#!/bin/bash
#
# lib/stx-update
# Functions to control the configuration and operation of stx-update
# Dependencies:
#
# - ``functions`` file
# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
# - ``SERVICE_{TENANT_NAME|PASSWORD}`` must be defined
# - ``SERVICE_HOST``
# - ``KEYSTONE_TOKEN_FORMAT`` must be defined
# ``stack.sh`` calls the entry points in this order:
#
# - install_tsconfig
# - install_XX
# - configure_XX
# - init_XX
# - start_XX
# - stop_XX
# - cleanup_XX
_XTRACE_STX_UPDATE=$(set +o | grep xtrace)
set -o xtrace
# Defaults
# --------
STXUPDATE_REPO=${STXUPDATE_REPO:-${GIT_BASE}/openstack/stx-update.git}
STXUPDATE_DIR=$DEST/stx-update
STXUPDATE_BRANCH=${STXUPDATE_BRANCH:-master}
TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig/
STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch/
STX_BIN_DIR=$(get_python_exec_prefix)
PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
function install_tsconfig {
# no setup.cfg in tsconfig, so we can not use pip install -e
# setup_dev_lib "tsconfig"
pushd $TSCONFIG_DIR/tsconfig
sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed
popd
sudo install -d -m 755 $STX_BIN_DIR
sudo install -p -D -m 700 $TSCONFIG_DIR/scripts/tsconfig $STX_BIN_DIR/tsconfig
}
function install_patch {
pushd $STX_PATCH_DIR/cgcs-patch
sudo python setup.py install --root=/ --install-lib=$PYTHON_SITE_DIR --prefix=/usr --install-data=/usr/share --single-version-externally-managed
popd
local stx_patch_sbindir=/etc/sbin/
local stx_patch_sysconfdir=/etc/
sudo install -m 755 -d ${stx_patch_sbindir}
sudo install -m 755 -d ${stx_patch_sysconfdir}/bash_completion.d
sudo install -m 755 -d ${stx_patch_sysconfdir}/goenabled.d
sudo install -m 755 -d ${stx_patch_sysconfdir}/init.d
sudo install -m 755 -d ${stx_patch_sysconfdir}/logrotate.d
sudo install -m 755 -d ${stx_patch_sysconfdir}/patching
sudo install -m 755 -d ${stx_patch_sysconfdir}/patching/patch-scripts
sudo install -m 755 -d ${stx_patch_sysconfdir}/pmon.d
sudo install -m 500 $STX_PATCH_DIR/bin/sw-patch-agent ${stx_patch_sbindir}/sw-patch-agent
}
$_XTRACE_STX_UPDATE

View File

@ -0,0 +1,2 @@
#!/bin/bash
# Plug-in overrides

48
devstack/plugin.sh Executable file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# devstack/plugin.sh
# Triggers stx_update specific functions to install and configure stx_update
# Dependencies:
#
# - ``functions`` file
# - ``DATA_DIR`` must be defined
# ``stack.sh`` calls the entry points in this order:
#
echo_summary "stx-update devstack plugin.sh called: $1/$2"
source $DEST/stx-update/devstack/lib/stx-update
# check for service enabled
if is_service_enabled stx-update; then
if [[ "$1" == "stack" && "$2" == "install" ]]; then
# Perform installation of source
echo_summary "Installing stx-update"
# install_update
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
# Configure after the other layer 1 and 2 services have been configured
echo_summary "Configuring update"
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
# Initialize and start the service
echo_summary "Initializing and start stx-update"
# init_update
# start_update
elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then
# do sanity test
echo_summary "do test-config"
fi
if [[ "$1" == "unstack" ]]; then
# Shut down services
echo_summary "Stop service"
# stop_update
:
fi
if [[ "$1" == "clean" ]]; then
echo_summary "Clean stx-update"
# cleanup_update
:
fi
fi

12
devstack/settings Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# Devstack settings
# Defaults
# --------
STX_UPDATE_NAME=stx-update
######### Plugin Specific ##########
enable_service $STX_UPDATE_NAME tsconfig
#define_plugin $STX_UPDATE_NAME
#plugin_requires ???