Skip to content

Commit

Permalink
prefetch-task-rhsm-integration
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Cook <[email protected]>
  • Loading branch information
brianwcook committed Jul 26, 2024
1 parent 4779a5a commit 22f5975
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ spec:
yq 'del(.goproxy_url)' <<<"${CONFIG_FILE_CONTENT}" >/mnt/config/config.yaml
fi
- name: prefetch-dependencies
image: quay.io/redhat-appstudio/cachi2:0.9.1@sha256:df67f9e063b544a8c49a271359377fed560562615e0278f6d0b9a3485f3f8fad
image: quay.io/bcook/cachi2@sha256:cd0ee8284eb41838071e7987644fcfe05cef77f89ac426c14a2fa4ed5bd1b5ac
volumeMounts:
- mountPath: /mnt/trusted-ca
name: trusted-ca
Expand Down Expand Up @@ -212,8 +212,27 @@ spec:
update-ca-trust
fi
cachi2 --log-level="$LOG_LEVEL" $config_flag fetch-deps \
$dev_pacman_flag \
cachi2 --log-level="$LOG_LEVEL" fetch-deps \
ACTIVATION_KEY_PATH="/activation-key"
if [ -d "$ACTIVATION_KEY_PATH" ]; then
echo "Detected activation key, registering with RHSM."
# todo: make sure orgid key is consistent with buildah task and docs
subscription-manager register \
--org $(cat "/activation-key/orgid") \
--activationkey $(cat "/activation-key/activationkey")
# detect entitlement certs and setup environment variables
ls /etc/pki/entitlement/
export RHSM_ID=$(ls /etc/pki/entitlement/ | grep key | cut -d - -f 1)
echo $RHSM_ID
export C2_CLIENT_CERT="/etc/pki/entitlement/$RHSM_ID.pem"
export C2_CLIENT_KEY="/etc/pki/entitlement/$RHSM_ID-key.pem"
echo "Using client certificate $C2_CLIENT_CERT and key $C2_CLIENT_KEY."
fi
$dev_pacman_flag \
--source=/var/workdir/source \
--output=/var/workdir/cachi2/output \
"${INPUT}"
Expand Down
24 changes: 22 additions & 2 deletions task/prefetch-dependencies/0.1/prefetch-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
yq 'del(.goproxy_url)' <<< "${CONFIG_FILE_CONTENT}" > /mnt/config/config.yaml
fi
- image: quay.io/redhat-appstudio/cachi2:0.9.1@sha256:df67f9e063b544a8c49a271359377fed560562615e0278f6d0b9a3485f3f8fad
- image: quay.io/bcook/cachi2@sha256:cd0ee8284eb41838071e7987644fcfe05cef77f89ac426c14a2fa4ed5bd1b5ac
# per https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting
# the cluster will set imagePullPolicy to IfNotPresent
name: prefetch-dependencies
Expand Down Expand Up @@ -146,7 +146,27 @@ spec:
update-ca-trust
fi
cachi2 --log-level="$LOG_LEVEL" $config_flag fetch-deps \
cachi2 --log-level="$LOG_LEVEL" fetch-deps \
ACTIVATION_KEY_PATH="/activation-key"
if [ -d "$ACTIVATION_KEY_PATH" ]; then
echo "Detected activation key, registering with RHSM."
# todo: make sure orgid key is consistent with buildah task and docs
subscription-manager register \
--org $(cat "/activation-key/orgid") \
--activationkey $(cat "/activation-key/activationkey")
# detect entitlement certs and setup environment variables
ls /etc/pki/entitlement/
export RHSM_ID=$(ls /etc/pki/entitlement/ | grep key | cut -d - -f 1)
echo $RHSM_ID
export C2_CLIENT_CERT="/etc/pki/entitlement/$RHSM_ID.pem"
export C2_CLIENT_KEY="/etc/pki/entitlement/$RHSM_ID-key.pem"
echo "Using client certificate $C2_CLIENT_CERT and key $C2_CLIENT_KEY."
fi
$dev_pacman_flag \
--source=$(workspaces.source.path)/source \
--output=$(workspaces.source.path)/cachi2/output \
Expand Down

0 comments on commit 22f5975

Please sign in to comment.