Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove uploading ci images to cleura #958

Merged
merged 1 commit into from
Jan 28, 2025
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
37 changes: 1 addition & 36 deletions jenkins/image_building/upload-ci-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,6 @@ install_openstack_client() {
pip install python-openstackclient==7.0.0
}

upload_ci_image_cleura() {

img_name="$1"

# Push image to openstack Kna1 cleura
export OS_USERNAME="${OPENSTACK_USERNAME_CLEURA}"
export OS_PASSWORD="${OPENSTACK_PASSWORD_CLEURA}"
export OS_AUTH_URL="https://kna1.citycloud.com:5000"
export OS_USER_DOMAIN_NAME="CCP_Domain_37137"
export OS_PROJECT_DOMAIN_NAME="CCP_Domain_37137"
export OS_REGION_NAME="Kna1"
export OS_PROJECT_NAME="Default Project 37137"
export OS_TENANT_NAME="Default Project 37137"
export OS_AUTH_VERSION=3
export OS_IDENTITY_API_VERSION=3

# Check if the common image already exists
if openstack image show "${COMMON_IMAGE_NAME}" &>/dev/null; then
# Get the original name of the current common image
original_name=$(openstack image show -f json -c properties "${COMMON_IMAGE_NAME}" | jq -r .properties.image_name)
# Rename the existing common image back to its original name
openstack image set --name "${original_name}" "${COMMON_IMAGE_NAME}"
fi

# Create the new image with the common name
openstack image create "${COMMON_IMAGE_NAME}" --file "${img_name}".qcow2 --disk-format=qcow2 --property image_name="${img_name}"

# delete old images (keeps latest five)
delete_old_images

#unset openstack variables
unset "${!OS_@}"
}

upload_ci_image_xerces() {
img_name="$1"

Expand Down Expand Up @@ -100,9 +66,8 @@ upload_ci_image_xerces() {
unset "${!OS_@}"
}

# If the script was run directly (i.e. not sourced), run both of the upload functions
# If the script was run directly (i.e. not sourced), run upload functions
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
install_openstack_client
upload_ci_image_cleura "$@"
upload_ci_image_xerces "$@"
fi
1 change: 0 additions & 1 deletion jenkins/jobs/clean_resources.pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ pipeline {
script {
withCredentials([
usernamePassword(credentialsId: 'xerces-est-metal3ci', usernameVariable: 'OPENSTACK_USERNAME_XERCES', passwordVariable: 'OPENSTACK_PASSWORD_XERCES'),
usernamePassword(credentialsId: 'metal3ci_city_cloud_openstack_credentials', usernameVariable: 'OPENSTACK_USERNAME_CLEURA', passwordVariable: 'OPENSTACK_PASSWORD_CLEURA'),
]) {
timestamps {
sh "./jenkins/scripts/clean_resources.sh"
Expand Down
1 change: 0 additions & 1 deletion jenkins/jobs/image_building.pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ pipeline {
steps {
withCredentials([
usernamePassword(credentialsId: 'xerces-est-metal3ci', usernameVariable: 'OPENSTACK_USERNAME_XERCES', passwordVariable: 'OPENSTACK_PASSWORD_XERCES'),
usernamePassword(credentialsId: 'metal3ci_city_cloud_openstack_credentials', usernameVariable: 'OPENSTACK_USERNAME_CLEURA', passwordVariable: 'OPENSTACK_PASSWORD_CLEURA'),
usernamePassword(credentialsId: 'infra-nordix-artifactory-api-key', usernameVariable: 'RT_USER', passwordVariable: 'RT_TOKEN')
]) {
script {
Expand Down
14 changes: 0 additions & 14 deletions jenkins/scripts/clean_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,6 @@ pip install python-openstackclient=="${CLIENT_VERSION}"
# export openstackclient path
export PATH="${PATH}:${HOME}/.local/bin"

# Cleaning up CLEURA resources
export OS_USERNAME="${OPENSTACK_USERNAME_CLEURA}"
export OS_PASSWORD="${OPENSTACK_PASSWORD_CLEURA}"
export OS_AUTH_URL="https://kna1.citycloud.com:5000"
export OS_USER_DOMAIN_NAME="CCP_Domain_37137"
export OS_PROJECT_DOMAIN_NAME="CCP_Domain_37137"
export OS_REGION_NAME="Kna1"
export OS_PROJECT_NAME="Default Project 37137"
export OS_TENANT_NAME="Default Project 37137"
export OS_AUTH_VERSION=3
export OS_IDENTITY_API_VERSION=3
echo "Cleaning up Cleura"
cleanup

#unset openstack variables
unset "${!OS_@}"

Expand Down
Loading