Use the Airship CLI for lint and Airskiff gates

Using Airship CLI script allows us to use pegleg
image configured in versions.yaml, which will be
updated during regular uplift procedure.

Change-Id: I68a6e5477fc72fb52dfc893b6eef69dd64320ded
This commit is contained in:
Evgeny L 2019-04-26 16:35:14 +00:00
parent 4e6a60ce1a
commit 5343f76bc1
6 changed files with 15 additions and 38 deletions

View File

@ -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

View File

@ -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

View File

@ -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 \

View File

@ -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}"

View File

@ -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

View File

@ -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