Treasuremap gate script fixes

* With the new directory structure in tools/depoyments there is a
conflict with the airshipctl dependency in treasuremap. So using
the treasuremap specific playbooks for gate runner tasks.

Change-Id: Id64f5b8000cb646d5dd2acc5d1d4179729e2ee4e
This commit is contained in:
Sirajudeen 2021-06-08 02:43:21 +00:00
parent 3b38faea51
commit fa049f7d38
5 changed files with 111 additions and 27 deletions

View File

@ -1 +0,0 @@
../common/25_deploy_ephemeral_node.sh

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -xe
: ${AIRSHIPCTL_PROJECT:="../airshipctl"}
cd ${AIRSHIPCTL_PROJECT}
./tools/deployment/25_deploy_ephemeral_node.sh

View File

@ -0,0 +1,30 @@
apiVersion: airshipit.org/v1alpha1
managementConfiguration:
dummy_management_config:
type: ${REMOTE_TYPE}
insecure: ${REMOTE_INSECURE}
useproxy: ${REMOTE_PROXY}
systemActionRetries: ${SYSTEM_ACTION_RETRIES}
systemRebootDelay: ${SYSTEM_REBOOT_DELAY}
contexts:
ephemeral-cluster:
manifest: dummy_manifest
managementConfiguration: dummy_management_config
target-cluster:
manifest: dummy_manifest
managementConfiguration: dummy_management_config
currentContext: ephemeral-cluster
kind: Config
manifests:
dummy_manifest:
phaseRepositoryName: primary
repositories:
primary:
checkout:
branch: ${AIRSHIP_CONFIG_PHASE_REPO_BRANCH}
force: false
remoteRef: ""
tag: ""
url: ${AIRSHIP_CONFIG_PHASE_REPO_URL}
metadataPath: ${AIRSHIP_CONFIG_METADATA_PATH}
targetPath: ${AIRSHIP_CONFIG_MANIFEST_DIRECTORY}

View File

@ -1,21 +1,47 @@
#!/usr/bin/env bash
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
set -xe
export AIRSHIPCTL_PROJECT=${AIRSHIPCTL_PROJECT:="../airshipctl"}
export IMAGE_DIR=${IMAGE_DIR:-"/srv/images"}
export SERVE_PORT=${SERVE_PORT:-"8099"}
export AIRSHIPCTL_WS=${AIRSHIPCTL_WS:-$PWD}
export TMP_DIR=${TMP_DIR:-"$(dirname $(mktemp -u))"}
cd ${AIRSHIPCTL_PROJECT}
./tools/gate/00_setup.sh
ANSIBLE_CFG=${ANSIBLE_CFG:-"${HOME}/.ansible.cfg"}
ANSIBLE_HOSTS=${ANSIBLE_HOSTS:-"${TMP_DIR}/ansible_hosts"}
PLAYBOOK_CONFIG=${PLAYBOOK_CONFIG:-"${TMP_DIR}/config.yaml"}
mkdir -p "$TMP_DIR"
envsubst <"${AIRSHIPCTL_WS}/tools/gate/config_template.yaml" > "$PLAYBOOK_CONFIG"
# use new version of ansible, Ubuntu has old one
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt -y install software-properties-common python3-pip curl wget ca-certificates
sudo DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install docker.io make
PACKAGES="ansible netaddr"
if [[ -z "${http_proxy}" ]]; then
sudo pip3 install $PACKAGES
else
sudo pip3 --proxy "${http_proxy}" install $PACKAGES
fi
echo "primary ansible_host=localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python3" > "$ANSIBLE_HOSTS"
printf "[defaults]\nroles_path = %s/roles\n" "$AIRSHIPCTL_WS" > "$ANSIBLE_CFG"

View File

@ -1,20 +1,28 @@
#!/usr/bin/env bash
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
set -xe
: ${AIRSHIPCTL_PROJECT:="../airshipctl"}
TMP_DIR=${TMP_DIR:-"$(dirname $(mktemp -u))"}
ANSIBLE_HOSTS=${ANSIBLE_HOSTS:-"${TMP_DIR}/ansible_hosts"}
PLAYBOOK_CONFIG=${PLAYBOOK_CONFIG:-"${TMP_DIR}/config.yaml"}
cd ${AIRSHIPCTL_PROJECT}
./tools/gate/10_build_gate.sh
sudo -E ansible-playbook -i "$ANSIBLE_HOSTS" \
playbooks/airship-treasuremap-build-gate.yaml \
-e @"$PLAYBOOK_CONFIG"

View File

@ -22,8 +22,8 @@ set -xe
TMP_DIR=${TMP_DIR:-"$(dirname $(mktemp -u))"}
ANSIBLE_HOSTS=${ANSIBLE_HOSTS:-"${TMP_DIR}/ansible_hosts"}
PLAYBOOK_CONFIG=${PLAYBOOK_CONFIG:-"${TMP_DIR}/config.yaml"}
export AIRSHIPCTL_WS=${AIRSHIPCTL_WS:-"../airshipctl"}
export AIRSHIPCTL_WS=${AIRSHIPCTL_WS:-$PWD}
export AIRSHIP_CONFIG_PHASE_REPO_URL=${AIRSHIP_CONFIG_PHASE_REPO_URL:-$PWD}
sudo -E --preserve-env=AIRSHIPCTL_WS ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -i "$ANSIBLE_HOSTS" \
playbooks/airship-treasuremap-gate-runner.yaml \