From 8231278f8208091173ca59aefa013009782268b9 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 7 Mar 2019 14:05:33 -0600 Subject: [PATCH] Set DevStack install dir to /usr/local by default Put everything in /usr/local and allow that to be overridden to a user-writable dir and not require sudo. Also set the stx-devstack-update job voting, at this time it only runs on devstack/* changes. Change-Id: Ibb27af08e4eaa0ba82d737e1af438a992ec35bfb Signed-off-by: Dean Troyer --- .zuul.yaml | 3 +-- devstack/lib/stx-integ | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index f9212f67c..9ede7282a 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -8,8 +8,7 @@ - openstack-tox-pep8 - openstack-tox-linters - stx-integ-pylint - - stx-devstack-integ: - voting: false + - stx-devstack-integ gate: jobs: - build-openstack-releasenotes diff --git a/devstack/lib/stx-integ b/devstack/lib/stx-integ index 7683341ca..017becc96 100644 --- a/devstack/lib/stx-integ +++ b/devstack/lib/stx-integ @@ -22,8 +22,14 @@ STXINTEG_DIR=${GITDIR[$STX_INTEG_NAME]} PLATFORM_UTIL_DIR=$STXINTEG_DIR/utilities/platform-util # 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 +STX_INST_DIR=${STX_INST_DIR:-/usr/local} +STX_BIN_DIR=${STX_BIN_DIR:-$STX_INST_DIR/bin} +STX_SBIN_DIR=${STX_SBIN_DIR:-$STX_INST_DIR/sbin} + +# Set up so we don't use sudo for installs when not necessary +STX_SUDO="sudo" +[[ -w $STX_INST_DIR ]] && STX_SUDO="env" + PYTHON_SITE_DIR=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") function cleanup_integ { @@ -58,16 +64,15 @@ function install_platform_util { --single-version-externally-managed popd - local stx_integ_sbindir=$STX_INST_DIR/sbin local systemddir=/etc/systemd - sudo install -m 755 -d ${stx_integ_sbindir} - sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/patch-restart-mtce ${stx_integ_sbindir} - sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/patch-restart-processes ${stx_integ_sbindir} - sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/patch-restart-haproxy ${stx_integ_sbindir} + $STX_SUDO install -m 755 -d ${STX_SBIN_DIR} + $STX_SUDO install -m 755 $PLATFORM_UTIL_DIR/scripts/patch-restart-mtce ${STX_SBIN_DIR} + $STX_SUDO install -m 755 $PLATFORM_UTIL_DIR/scripts/patch-restart-processes ${STX_SBIN_DIR} + $STX_SUDO install -m 755 $PLATFORM_UTIL_DIR/scripts/patch-restart-haproxy ${STX_SBIN_DIR} - sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/cgcs_tc_setup.sh ${STX_BIN_DIR} - sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/remotelogging_tc_setup.sh ${STX_BIN_DIR} - sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/connectivity_test ${STX_BIN_DIR} + $STX_SUDO install -m 755 $PLATFORM_UTIL_DIR/scripts/cgcs_tc_setup.sh ${STX_BIN_DIR} + $STX_SUDO install -m 755 $PLATFORM_UTIL_DIR/scripts/remotelogging_tc_setup.sh ${STX_BIN_DIR} + $STX_SUDO install -m 755 $PLATFORM_UTIL_DIR/scripts/connectivity_test ${STX_BIN_DIR} # sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/opt-platform.mount ${systemddir}/system # sudo install -m 755 $PLATFORM_UTIL_DIR/scripts/opt-platform.service ${systemddir}/system