Skip to content

Commit

Permalink
Merge pull request #614 from IBM/fk-misc-redo
Browse files Browse the repository at this point in the history
Redo reverted PR
  • Loading branch information
fketelaars authored Jan 5, 2024
2 parents 4373682 + 94bb5f0 commit 354bdae
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- name: If air-gapped, copy case files from {{ status_dir }}/cp4d/offline to /tmp/work/offline
copy:
src: "{{ status_dir }}/cp4d/offline"
dest: /tmp/work/offline
dest: /tmp/work/
remote_src: True
when: (cpd_airgap | default(False) | bool)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@
failed_when: False
register: _mirror_images

- name: Copy case files from /tmp/work/offline to {{ status_dir }}/cp4d/
copy:
src: /tmp/work/offline
dest: "{{ status_dir }}/cp4d/"
remote_src: True

- name: Stop script that mirrors log files
file:
path: "/tmp/mirroring-complete.txt"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

31 changes: 23 additions & 8 deletions cp-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,18 @@ if ! $INSIDE_CONTAINER;then
fi
fi

# If images have not been overridden, set the variables here
if [ -z $CPD_OLM_UTILS_V1_IMAGE ];then
export CPD_OLM_UTILS_V1_IMAGE=icr.io/cpopen/cpd/olm-utils:latest
else
echo "Custom olm-utils image ${CPD_OLM_UTILS_V1_IMAGE} will be used."
fi
if [ -z $CPD_OLM_UTILS_V2_IMAGE ];then
export CPD_OLM_UTILS_V2_IMAGE=icr.io/cpopen/cpd/olm-utils-v2:latest
else
echo "Custom olm-utils-v2 image ${CPD_OLM_UTILS_V2_IMAGE} will be used."
fi

if ! $INSIDE_CONTAINER;then
# Check if podman or docker command was found
if [ -z $CPD_CONTAINER_ENGINE ];then
Expand Down Expand Up @@ -626,13 +638,6 @@ if ! $INSIDE_CONTAINER;then
chmod +x ${SCRIPT_DIR}/.version-info/version-info.sh
# Show version info
cat ${SCRIPT_DIR}/.version-info/version-info.sh
# If images have not been overridden, set the variables here
if [ -z $CPD_OLM_UTILS_V1_IMAGE ];then
export CPD_OLM_UTILS_V1_IMAGE=icr.io/cpopen/cpd/olm-utils:latest
fi
if [ -z $CPD_OLM_UTILS_V2_IMAGE ];then
export CPD_OLM_UTILS_V2_IMAGE=icr.io/cpopen/cpd/olm-utils-v2:latest
fi
# Build the image
${CPD_CONTAINER_ENGINE} build -t cloud-pak-deployer:${CPD_IMAGE_TAG} \
--pull \
Expand Down Expand Up @@ -889,12 +894,22 @@ if ! $INSIDE_CONTAINER;then
fi
fi

# If download action, save Deployer image
# If download action, save Deployer and olm-utils images
if [[ "${ACTION}" == "download" ]] && ! ${CHECK_ONLY};then
echo "Removing old archives for deployer container image"
rm -f ${STATUS_DIR}/downloads/cloud-pak-deployer-image.tar
echo "Saving Deployer container image cloud-pak-deployer:${CPD_IMAGE_TAG} into ${STATUS_DIR}/downloads/cloud-pak-deployer-image.tar"
${CPD_CONTAINER_ENGINE} save -o ${STATUS_DIR}/downloads/cloud-pak-deployer-image.tar cloud-pak-deployer:${CPD_IMAGE_TAG}

echo "Removing old archives for olm-utils container image"
rm -f ${STATUS_DIR}/downloads/olm-utils-image.tar
echo "Saving container image ${CPD_OLM_UTILS_V1_IMAGE} into ${STATUS_DIR}/downloads/olm-utils-image.tar"
${CPD_CONTAINER_ENGINE} save -o ${STATUS_DIR}/downloads/olm-utils-image.tar ${CPD_OLM_UTILS_V1_IMAGE}

echo "Removing old archives for olm-utils-v2 container image"
rm -f ${STATUS_DIR}/downloads/olm-utils-v2-image.tar
echo "Saving container image ${CPD_OLM_UTILS_V2_IMAGE} into ${STATUS_DIR}/downloads/olm-utils-v2-image.tar"
${CPD_CONTAINER_ENGINE} save -o ${STATUS_DIR}/downloads/olm-utils-v2-image.tar ${CPD_OLM_UTILS_V2_IMAGE}
fi

# Build command when not running inside container
Expand Down

0 comments on commit 354bdae

Please sign in to comment.