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 # See the License for the specific language governing permissions and
# limitations under the License. # 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 # Python YAML module required to read versions.yaml
dpkg -s python3-yaml &> /dev/null || apt -y install python3-yaml dpkg -s python3-yaml &> /dev/null || apt -y install python3-yaml

View File

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

View File

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

View File

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

View File

@ -16,11 +16,5 @@
set -xe 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. # TODO(drewwalters96): make Treasuremap sites P001 and P009 compliant.
IMAGE=${PEGLEG_IMG} TERM_OPTS=" " \ TERM_OPTS=" " ./tools/airship pegleg site -r . lint "$1" -x P001 -x P009
${PEGLEG} site -r . lint "$1" -x P001 -x P009

View File

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