Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions hack/boskos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -o pipefail

REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

USER="cluster-api-provider-ibmcloud"
USER=${USER:-"cluster-api-provider-ibmcloud"}

release_account(){
url="http://${BOSKOS_HOST}/release?name=${BOSKOS_RESOURCE_NAME}&dest=dirty&owner=${USER}"
Expand All @@ -43,12 +43,13 @@ checkout_account(){

if [[ ${status_code} == 200 ]]; then
export BOSKOS_RESOURCE_NAME=$(jq -r '.name' < output.json)
export IBMCLOUD_API_KEY=$(jq -r '.userdata["api-key"]' < output.json)
export BOSKOS_RESOURCE_GROUP=$(jq -r '.userdata["resource-group"]' < output.json)
export BOSKOS_REGION=$(jq -r '.userdata["region"]' < output.json)
if [[ ${resource_type} == "powervs-service" ]]; then
export BOSKOS_RESOURCE_ID=$(jq -r '.userdata["service-instance-id"]' < output.json)
api_key=$(jq -er '.userdata["api-key"]' < output.json 2>/dev/null) && export IBMCLOUD_API_KEY="$api_key"
if [[ ${resource_type} =~ "powervs" ]]; then
export BOSKOS_SERVICE_INSTANCE_ID=$(jq -r '.userdata["service-instance-id"]' < output.json)
export BOSKOS_ZONE=$(jq -r '.userdata["zone"]' < output.json)
elif [[ ${resource_type} =~ "vpc" ]]; then
export BOSKOS_RESOURCE_GROUP=$(jq -r '.userdata["resource-group"]' < output.json)
fi
rm -rf output.json
else
Expand Down
9 changes: 4 additions & 5 deletions scripts/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ create_powervs_network_instance(){
ibmcloud pi workspace target ${CRN}

# Create the network instance
${capibmadm} powervs network create --name ${IBMPOWERVS_NETWORK_NAME} --dns-servers 1.1.1.1,8.8.8.8,9.9.9.9 --service-instance-id ${IBMPOWERVS_SERVICE_INSTANCE_ID} --zone ${ZONE}
${capibmadm} powervs network create --name ${IBMPOWERVS_NETWORK_NAME} --dns-servers 1.1.1.1,8.8.8.8,9.9.9.9 --service-instance-id ${IBMPOWERVS_SERVICE_INSTANCE_ID} --zone ${IBMPOWERVS_ZONE}

}

Expand All @@ -107,10 +107,10 @@ init_network_powervs(){
create_powervs_network_instance

# Creating PowerVS network port
${capibmadm} powervs port create --network ${IBMPOWERVS_NETWORK_NAME} --description "capi-e2e" --service-instance-id ${IBMPOWERVS_SERVICE_INSTANCE_ID} --zone ${ZONE}
${capibmadm} powervs port create --network ${IBMPOWERVS_NETWORK_NAME} --description "capi-e2e" --service-instance-id ${IBMPOWERVS_SERVICE_INSTANCE_ID} --zone ${IBMPOWERVS_ZONE}

# Get and assign the IPs to the required variables
NEW_PORT=$(${capibmadm} powervs port list --service-instance-id ${IBMPOWERVS_SERVICE_INSTANCE_ID} --zone ${ZONE} --network ${IBMPOWERVS_NETWORK_NAME} -o json)
NEW_PORT=$(${capibmadm} powervs port list --service-instance-id ${IBMPOWERVS_SERVICE_INSTANCE_ID} --zone ${IBMPOWERVS_ZONE} --network ${IBMPOWERVS_NETWORK_NAME} -o json)
no_of_ports=$(echo ${NEW_PORT} | jq '.items | length')
if [[ ${no_of_ports} != 1 ]]; then
echo "Failed to get the required number or ports, got - ${no_of_ports}"
Expand All @@ -125,9 +125,8 @@ prerequisites_powervs(){
# Assigning PowerVS variables
export IBMPOWERVS_SSHKEY_NAME=${IBMPOWERVS_SSHKEY_NAME:-"powercloud-bot-key"}
export IBMPOWERVS_IMAGE_NAME=${IBMPOWERVS_IMAGE_NAME:-"capibm-powervs-centos-streams9-1-33-1"}
export IBMPOWERVS_SERVICE_INSTANCE_ID=${BOSKOS_RESOURCE_ID:-"d53da3bf-1f4a-42fa-9735-acf16b1a05cd"}
export IBMPOWERVS_SERVICE_INSTANCE_ID=${BOSKOS_SERVICE_INSTANCE_ID:-"d53da3bf-1f4a-42fa-9735-acf16b1a05cd"}
export IBMPOWERVS_NETWORK_NAME="capi-net-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head --bytes 5)"
export ZONE=${BOSKOS_ZONE:-"osa21"}
export IBMPOWERVS_REGION=${BOSKOS_REGION:-"osa"}
export IBMPOWERVS_ZONE=${BOSKOS_ZONE:-"osa21"}
init_network_powervs
Expand Down