DevStack plugin updates for bionic job
This makes some cleanup changes to the DevStack plugin for the change to master and bionic. * Define values for precedence handling by the upstream devstack playbook * Add STX_INST_DIR for a deterministic install location * Update the linters job in tox.ini to correctly include the devstack plugin Change-Id: Ida3a6c07d49510a6ec0276e83a3f966b826de26e Signed-off-by: Dean Troyer <dtroyer@gmail.com>
This commit is contained in:
parent
c763e0de07
commit
6be5a751c9
@ -1,12 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# lib/stx-update
|
# lib/stx-update
|
||||||
# Functions to control the configuration and operation of stx-update
|
|
||||||
|
|
||||||
# Dependencies:
|
|
||||||
#
|
|
||||||
# - ``functions`` file
|
|
||||||
# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined
|
|
||||||
|
|
||||||
# ``stack.sh`` calls the entry points in this order:
|
# ``stack.sh`` calls the entry points in this order:
|
||||||
#
|
#
|
||||||
@ -25,20 +19,27 @@ set -o xtrace
|
|||||||
# --------
|
# --------
|
||||||
|
|
||||||
STXUPDATE_REPO=${STXUPDATE_REPO:-${GIT_BASE}/openstack/stx-update.git}
|
STXUPDATE_REPO=${STXUPDATE_REPO:-${GIT_BASE}/openstack/stx-update.git}
|
||||||
STXUPDATE_DIR=$DEST/stx-update
|
STXUPDATE_DIR=${GITDIR[$STX_UPDATE_NAME]}
|
||||||
|
|
||||||
STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch/
|
STX_PATCH_DIR=$STXUPDATE_DIR/cgcs-patch/
|
||||||
TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig/
|
TSCONFIG_DIR=$STXUPDATE_DIR/tsconfig/
|
||||||
|
|
||||||
STX_BIN_DIR=$(get_python_exec_prefix)
|
# STX_INST_DIR should be a non-root-writable place to install build artifacts
|
||||||
|
STX_INST_DIR=${STX_INST_DIR:-$DEST/usr}
|
||||||
|
STX_BIN_DIR=$STX_INST_DIR/bin
|
||||||
PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
|
||||||
|
|
||||||
function install_sw_patch {
|
function install_sw_patch {
|
||||||
pushd $STX_PATCH_DIR/cgcs-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
|
sudo python setup.py install \
|
||||||
|
--root=/ \
|
||||||
|
--install-lib=$PYTHON_SITE_DIR \
|
||||||
|
--prefix=/usr \
|
||||||
|
--install-data=/usr/share \
|
||||||
|
--single-version-externally-managed
|
||||||
popd
|
popd
|
||||||
|
|
||||||
local stx_patch_sbindir=/usr/local/sbin/
|
local stx_patch_sbindir=$STX_INST_DIR/sbin
|
||||||
local stx_patch_sysconfdir=/etc/
|
local stx_patch_sysconfdir=/etc/
|
||||||
sudo install -m 755 -d ${stx_patch_sbindir}
|
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}/bash_completion.d
|
||||||
@ -55,7 +56,12 @@ function install_tsconfig {
|
|||||||
# no setup.cfg in tsconfig, so we can not use pip install -e
|
# no setup.cfg in tsconfig, so we can not use pip install -e
|
||||||
# setup_dev_lib "tsconfig"
|
# setup_dev_lib "tsconfig"
|
||||||
pushd $TSCONFIG_DIR/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
|
sudo python setup.py install \
|
||||||
|
--root=/ \
|
||||||
|
--install-lib=$PYTHON_SITE_DIR \
|
||||||
|
--prefix=/usr \
|
||||||
|
--install-data=/usr/share \
|
||||||
|
--single-version-externally-managed
|
||||||
popd
|
popd
|
||||||
sudo install -d -m 755 $STX_BIN_DIR
|
sudo install -d -m 755 $STX_BIN_DIR
|
||||||
sudo install -p -D -m 700 $TSCONFIG_DIR/scripts/tsconfig $STX_BIN_DIR/tsconfig
|
sudo install -p -D -m 700 $TSCONFIG_DIR/scripts/tsconfig $STX_BIN_DIR/tsconfig
|
||||||
@ -69,4 +75,5 @@ function install_update {
|
|||||||
install_tsconfig
|
install_tsconfig
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
$_XTRACE_STX_UPDATE
|
$_XTRACE_STX_UPDATE
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# devstack/plugin.sh
|
# devstack/plugin.sh
|
||||||
# Triggers stx_update specific functions to install and configure stx_update
|
# Triggers specific functions to install and configure stx-update
|
||||||
|
|
||||||
echo_summary "stx-update devstack plugin.sh called: $1/$2"
|
echo_summary "stx-update devstack plugin.sh called: $1/$2"
|
||||||
|
|
||||||
@ -14,6 +14,7 @@ if is_service_enabled stx-update; then
|
|||||||
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
||||||
# Configure after the other layer 1 and 2 services have been configured
|
# Configure after the other layer 1 and 2 services have been configured
|
||||||
echo_summary "Configure stx-update"
|
echo_summary "Configure stx-update"
|
||||||
|
# configure_update
|
||||||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
|
||||||
# Initialize and start the service
|
# Initialize and start the service
|
||||||
echo_summary "Initialize and start stx-update"
|
echo_summary "Initialize and start stx-update"
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Devstack settings
|
# Devstack settings
|
||||||
|
|
||||||
|
# This plugin enables StarlingX stx-update services and follows the
|
||||||
|
# DevStack plugin contract:
|
||||||
|
# https://docs.openstack.org/devstack/latest/plugins.html#plugin-sh-contract
|
||||||
|
|
||||||
|
# Services
|
||||||
|
# sw-patch
|
||||||
|
# tsconfig
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
# --------
|
# --------
|
||||||
|
|
||||||
@ -8,7 +16,11 @@ STX_UPDATE_NAME=stx-update
|
|||||||
|
|
||||||
######### Plugin Specific ##########
|
######### Plugin Specific ##########
|
||||||
enable_service $STX_UPDATE_NAME
|
enable_service $STX_UPDATE_NAME
|
||||||
#define_plugin $STX_UPDATE_NAME
|
|
||||||
|
# This must not use any variables to work properly in OpenStack's DevStack playbook
|
||||||
|
define_plugin stx-update
|
||||||
|
# This works for Zuul jobs using OpenStack's DevStack roles
|
||||||
|
#plugin_requires stx-update stx-xxxx
|
||||||
|
|
||||||
# Initial source of lib script
|
# Initial source of lib script
|
||||||
source $DEST/stx-update/devstack/lib/stx-update
|
source $DEST/stx-update/devstack/lib/stx-update
|
||||||
|
16
tox.ini
16
tox.ini
@ -37,17 +37,21 @@ deps = -r{toxinidir}/requirements.txt
|
|||||||
basepython = python3
|
basepython = python3
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
commands =
|
commands =
|
||||||
bash -c "find {toxinidir} \
|
|
||||||
\( -name .tox -prune \) \
|
|
||||||
-o -type f -name '*.yaml' \
|
|
||||||
-print0 | xargs --no-run-if-empty -0 yamllint"
|
|
||||||
bash -c "find {toxinidir} \
|
bash -c "find {toxinidir} \
|
||||||
-not \( -type d -name .?\* -prune \) \
|
-not \( -type d -name .?\* -prune \) \
|
||||||
-type f \
|
-type f \
|
||||||
-not -name \*~ \
|
-not -name \*~ \
|
||||||
-not -name \*.md \
|
-not -name \*.md \
|
||||||
-name \*.sh \
|
\( \
|
||||||
-print0 | xargs --no-run-if-empty -0 bashate -v -e 'E*' -iE006"
|
-name \*.sh \
|
||||||
|
-or -not -wholename \*/devstack/files/\* \
|
||||||
|
-wholename \*/devstack/\* \
|
||||||
|
\) \
|
||||||
|
-print0 | xargs -0 bashate -v -e 'E*' -iE006"
|
||||||
|
bash -c "find {toxinidir} \
|
||||||
|
\( -name .tox -prune \) \
|
||||||
|
-o -type f -name '*.yaml' \
|
||||||
|
-print0 | xargs -0 yamllint"
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
# ignore below errors , will fix flake8 errors in future
|
# ignore below errors , will fix flake8 errors in future
|
||||||
|
Loading…
Reference in New Issue
Block a user