# script is executing rather than being sourced. When executed the condition
# is true and copies the script. In the false path this copy below is skipped
# and the sourcing continues so that the appended common-function.sh ends up sourced.
-if [ "${BASH_SOURCE[0]}" == "${0}" ]; then
+if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
+ # shellcheck disable=SC1090
+ . ~/lf-env.sh
+
+ lf-activate-venv --python python3 \
+ python-heatclient \
+ python-openstackclient
+
echo "Copying common-functions.sh to /tmp"
cp "${0}" /tmp/common-functions.sh
#!/bin/bash -l
+
+# shellcheck disable=SC1090
+. ~/lf-env.sh
+
+lf-activate-venv --python python3 \
+ python-heatclient \
+ python-openstackclient \
+ yq
+
# Get the Controller and Tools VM slave addresses
set -x
# shellcheck disable=SC1090
. ~/lf-env.sh
-
-# Check if openstack venv was previously created
-if [ -f "/tmp/.os_lf_venv" ]; then
- os_lf_venv=$(cat "/tmp/.os_lf_venv")
-fi
-
-if [ -d "${os_lf_venv}" ] && [ -f "${os_lf_venv}/bin/openstack" ]; then
- echo "Re-use existing venv: ${os_lf_venv}"
- PATH=$os_lf_venv/bin:$PATH
-else
- lf-activate-venv --python python3 \
- python-heatclient \
- python-openstackclient \
- yq
-fi
+lf-activate-venv --python python3 \
+ python-heatclient \
+ python-openstackclient \
+ yq
# Print the Stack outputs parameters so that we can identify which IPs belong
# to which VM types.
# shellcheck disable=SC1090
. ~/lf-env.sh
-# Check if openstack venv was previously created
-if [ -f "/tmp/.os_lf_venv" ]; then
- os_lf_venv=$(cat "/tmp/.os_lf_venv")
-fi
-
-if [ -d "${os_lf_venv}" ] && [ -f "${os_lf_venv}/bin/openstack" ]; then
- echo "Re-use existing venv: ${os_lf_venv}"
- PATH=$os_lf_venv/bin:$PATH
-else
- lf-activate-venv --python python3 lftools
-fi
+lf-activate-venv --python python3 lftools
MAVEN_GROUP_ID=$(xmlstarlet sel \
-N "x=http://maven.apache.org/POM/4.0.0" \
# shellcheck disable=SC1090
. ~/lf-env.sh
-# Check if openstack venv was previously created
-if [ -f "/tmp/.os_lf_venv" ]; then
- os_lf_venv=$(cat "/tmp/.os_lf_venv")
-fi
-
-if [ -d "${os_lf_venv}" ] && [ -f "${os_lf_venv}/bin/openstack" ]; then
- echo "Re-use existing venv: ${os_lf_venv}"
- PATH=$os_lf_venv/bin:$PATH
-else
- lf-activate-venv --python python3 \
- decorator \
- python-heatclient \
- python-openstackclient \
- python-magnumclient \
- yq
-fi
+lf-activate-venv --python python3 \
+ decorator \
+ python-heatclient \
+ python-openstackclient \
+ python-magnumclient \
+ yq
JOB_SUM=$(echo "$JOB_NAME" | sum | awk '{{ print $1 }}')
VM_NAME="$JOB_SUM-$BUILD_NUMBER"
# shellcheck disable=SC1090
. ~/lf-env.sh
-# Check if openstack venv was previously created
-if [ -f "/tmp/.os_lf_venv" ]; then
- os_lf_venv=$(cat "/tmp/.os_lf_venv")
-fi
-
-if [ -d "${os_lf_venv}" ] && [ -f "${os_lf_venv}/bin/openstack" ]; then
- echo "Re-use existing venv: ${os_lf_venv}"
- PATH=$os_lf_venv/bin:$PATH
-else
- lf-activate-venv --python python3 python-openstackclient
-fi
+lf-activate-venv --python python3 python-openstackclient
cat > "$WORKSPACE/docs/cloud-images.rst" << EOF
Following are the list of published images available to Jenkins jobs.
echo "---> Delete K8S cluster"
set -eux -o pipefail
+
# shellcheck disable=SC1090
. ~/lf-env.sh
+lf-activate-venv --python python3 \
+ kubernetes \
+ python-heatclient \
+ python-openstackclient \
+ yq
+
os_cloud="${OS_CLOUD:-vex}"
cluster_name="${CLUSTER_NAME}"
# shellcheck disable=SC1090
. ~/lf-env.sh
+lf-activate-venv --python python3 \
+ kubernetes \
+ python-heatclient \
+ python-openstackclient \
+ yq
+
OS_TIMEOUT=5 # Wait time in minutes for OpenStack cluster nodes to come up.
CLUSTER_NODE_RETRIES=15 # Number of times to retry waiting for a cluster nodes.
CLUSTER_NODE_SUCCESSFUL=false
echo "---> Create K8S cluster with pre-existing template"
set -eux -o pipefail
+
# shellcheck disable=SC1090
. ~/lf-env.sh
-lf-activate-venv python-openstackclient python-magnumclient
+
+lf-activate-venv --python python3 \
+ python-heatclient \
+ python-openstackclient \
+ yq
OS_TIMEOUT=20 # Wait time in minutes for OpenStack cluster to come up.
CLUSTER_RETRIES=3 # Number of times to retry creating a cluster.