Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -119,40 +119,13 @@ spec:
requests:
memory: 128Mi
cpu: 50m
script: |
#!/usr/bin/env bash
set -eux

DATA_FILE="$(params.dataDir)/$(params.dataPath)"
if [ ! -f "${DATA_FILE}" ] ; then
echo "No valid data file was provided."
exit 1
fi

# Check if there is anything to make public - either in defaults, or a component
SECRET_REQUIRED=false
if [ "$(jq -r '.mapping.defaults.public // false' "$DATA_FILE")" = true ] ; then
SECRET_REQUIRED=true
else
NUM_COMPONENTS=$(jq '.mapping.components | length' "$DATA_FILE")
for ((i=0; i < NUM_COMPONENTS; i++)); do
COMPONENT=$(jq -c ".mapping.components[$i]" "$DATA_FILE")
if [ "$(jq -r '.public // false' <<< "$COMPONENT")" = true ] ; then
SECRET_REQUIRED=true
break
fi
done
fi

if [ "$SECRET_REQUIRED" = false ]; then
echo No repos to make public, so no secret is required. Exiting...
echo -n "" > "$(results.registrySecret.path)"
exit 0
fi

if [ "$(jq '.mapping | has("registrySecret")' "$DATA_FILE")" == false ] ; then
echo "Registry secret missing in data JSON file"
exit 1
fi

jq -j '.mapping.registrySecret' "$DATA_FILE" | tee "$(results.registrySecret.path)"
env:
- name: PARAM_DATA_DIR
value: $(params.dataDir)
- name: PARAM_DATA_PATH
value: $(params.dataPath)
- name: RESULT_REGISTRY_SECRET
value: $(results.registrySecret.path)
command:
- python3
- /home/scripts/python/tasks/managed/collect_registry_token_secret.py

This file was deleted.

This file was deleted.

This file was deleted.

Loading