diff --git a/catalog-info.generator.sh b/catalog-info.generator.sh index e917546..ffc1efa 100755 --- a/catalog-info.generator.sh +++ b/catalog-info.generator.sh @@ -15,6 +15,7 @@ if [ ! -f $META_DATA_FILE ]; then "manual_dependencies": [], "type": "application", "lifecycle": "production", + "manual_service_names": [], "example-service-name": { "tags" : [ "language:golang", @@ -54,6 +55,9 @@ squad_exist_in_team() { REPO_NAME=$(basename "$(pwd)") SERVICE_NAMES=(${(s: :)$(yq e '.jobs.repository-release-prod.with.helm_release_names' "$RELEASE_WORKFLOW")}) +if [[ ${#SERVICE_NAMES[@]} == 0 || "$SERVICE_NAMES" == "null" ]]; then + SERVICE_NAMES=(${(s: :)$(jq -r ".manual_service_names[]" $META_DATA_FILE)}) +fi if [[ ${#SERVICE_NAMES[@]} == 0 || "$SERVICE_NAMES" == "null" ]]; then SERVICE_NAMES=($REPO_NAME) fi @@ -62,6 +66,8 @@ SQUAD_NAME=$(yq e '.jobs.repository-release-prod.with.argocd_state_repo' "$RELEA SQUAD_NAME=$(echo "$SQUAD_NAME" | cut -c 14-50) if [[ -z $SQUAD_NAME || "$SQUAD_NAME" == "null" ]]; then SQUAD_NAME=$(jq -r '.squad_name' $META_DATA_FILE) +else + SQUAD_NAME="$SQUAD_NAME-squad" fi GH_TEAM="" if squad_exist_in_team "$SQUAD_NAME"; then @@ -145,10 +151,10 @@ done) spec: type: $TYPE lifecycle: $LIFECYCLE - owner: group:$SQUAD_NAME-squad + owner: group:$SQUAD_NAME $( if (( ${#DEPENDENCIES[@]} > 0 )); then - echo "dependsOn:" + echo " dependsOn:" fi ) $(for resource in "${DEPENDENCIES[@]}"; do @@ -163,4 +169,3 @@ fixed_content="${file_content%$'\n'}" echo "$fixed_content" > "$OUTPUT_FILE" echo "File generated: $OUTPUT_FILE" -