Browse Source

Merge "Use the Airship CLI for lint and Airskiff gates"

changes/61/656061/1
Zuul 3 years ago committed by Gerrit Code Review
parent
commit
5b4d214e89
  1. 5
      tools/airship
  2. 1
      tools/deployment/airskiff/developer/005-clone-dependencies.sh
  3. 11
      tools/deployment/airskiff/developer/030-armada-bootstrap.sh
  4. 26
      tools/deployment/airskiff/developer/100-deploy-osh.sh
  5. 8
      tools/gate/lint-site.sh
  6. 2
      tools/gate/wait-for-shipyard.sh

5
tools/airship

@ -14,7 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
: ${TERM_OPTS:='-it'}
DEFAULT_TERM_OPTS=' '
# Set an interactive mode only if there is a TTY available.
test -t 1 && test -t 0 && DEFAULT_TERM_OPTS='-it'
: ${TERM_OPTS:=${DEFAULT_TERM_OPTS}}
# Python YAML module required to read versions.yaml
dpkg -s python3-yaml &> /dev/null || apt -y install python3-yaml

1
tools/deployment/airskiff/developer/005-clone-dependencies.sh

@ -26,7 +26,6 @@ cd ${INSTALL_PATH}
# Clone Airship projects
git clone https://opendev.org/airship/armada.git
git clone https://opendev.org/airship/deckhand.git
git clone https://opendev.org/airship/pegleg.git
git clone https://opendev.org/airship/shipyard.git
# Clone dependencies

11
tools/deployment/airskiff/developer/030-armada-bootstrap.sh

@ -17,19 +17,12 @@
set -xe
CURRENT_DIR="$(pwd)"
: "${INSTALL_PATH:="$(pwd)/../"}"
: "${PL_PATH:="../pegleg"}"
# NOTE: Image to use for all Pegleg operations
: "${PL_IMAGE:=quay.io/airshipit/pegleg:latest}"
: "${PEGLEG:="${PL_PATH}/tools/pegleg.sh"}"
: "${PEGLEG:="./tools/airship pegleg"}"
: "${PL_SITE:="airskiff"}"
# Render documents
IMAGE=${PL_IMAGE} TERM_OPTS=" " ${PEGLEG} site -r . render "${PL_SITE}" -o airskiff.yaml
${PEGLEG} site -r . render "${PL_SITE}" -o airskiff.yaml
# Download latest Armada image and deploy Airship components
docker run --rm --net host -p 8000:8000 --name armada \

26
tools/deployment/airskiff/developer/100-deploy-osh.sh

@ -17,16 +17,10 @@
set -xe
# Deploy OpenStack using Airship
CURRENT_DIR="$(pwd)"
: "${PL_PATH:="../pegleg"}"
: "${SY_PATH:="../shipyard"}"
# NOTE: Image to use for all Pegleg operations
: "${PL_IMAGE:=quay.io/airshipit/pegleg:latest}"
# Lint deployment documents
: "${PEGLEG:="${PL_PATH}/tools/pegleg.sh"}"
: "${AIRSHIP_PATH:="./tools/airship"}"
: "${PEGLEG:="${AIRSHIP_PATH} pegleg"}"
: "${SHIPYARD:="${AIRSHIP_PATH} shipyard"}"
: "${PL_SITE:="airskiff"}"
# Source OpenStack credentials for Airship utility scripts
@ -35,23 +29,17 @@ CURRENT_DIR="$(pwd)"
# NOTE(drewwalters96): Disable Pegleg linting errors P001 and P009; a
# a cleartext storage policy is acceptable for non-production use cases
# and maintain consistency with other treasuremap sites.
IMAGE=${PL_IMAGE} TERM_OPTS=" " ${PEGLEG} site -r . lint "${PL_SITE}" -x P001 -x P009
${PEGLEG} site -r . lint "${PL_SITE}" -x P001 -x P009
# Collect deployment documents
: "${PL_OUTPUT:="peggles"}"
mkdir -p ${PL_OUTPUT}
IMAGE=${PL_IMAGE} TERM_OPTS="-l info" ${PEGLEG} site -r . collect ${PL_SITE} -s ${PL_OUTPUT}
cp -rp "${CURRENT_DIR}"/${PL_OUTPUT} ${SY_PATH}
# Deploy Airskiff site
cd ${SY_PATH}
: "${SHIPYARD:="./tools/shipyard.sh"}"
TERM_OPTS="-l info" ${PEGLEG} site -r . collect ${PL_SITE} -s ${PL_OUTPUT}
# Start the deployment
${SHIPYARD} create configdocs airskiff-design \
--replace \
--directory=/target/${PL_OUTPUT}
--directory=${PL_OUTPUT}
${SHIPYARD} commit configdocs
${SHIPYARD} create action update_software --allow-intermediate-commits
cd "${CURRENT_DIR}"

8
tools/gate/lint-site.sh

@ -16,11 +16,5 @@
set -xe
: "${PEGLEG_PATH:=../pegleg}"
: "${PEGLEG_IMG:=quay.io/airshipit/pegleg:b7556bd89e99f2a6539e97d5a4ac6738751b9c55}"
: "${PEGLEG:=${PEGLEG_PATH}/tools/pegleg.sh}"
# TODO(drewwalters96): make Treasuremap sites P001 and P009 compliant.
IMAGE=${PEGLEG_IMG} TERM_OPTS=" " \
${PEGLEG} site -r . lint "$1" -x P001 -x P009
TERM_OPTS=" " ./tools/airship pegleg site -r . lint "$1" -x P001 -x P009

2
tools/gate/wait-for-shipyard.sh

@ -16,7 +16,7 @@
set -e
: "${SHIPYARD:=../shipyard/tools/shipyard.sh}"
: "${SHIPYARD:=./tools/airship shipyard}"
# Source OpenStack credentials for Airship utility scripts
. tools/deployment/airskiff/common/os-env.sh

Loading…
Cancel
Save