Skip to content

Commit

Permalink
ww
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlockstar committed Aug 7, 2024
1 parent 088f669 commit dcd029f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 49 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/stage-3-build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,17 @@ jobs:
set -x
echo "AHL testing"
function_list="receive-caas-file add-participant lookup-validation mark-participant-as-ineligible retrieve-cohort-distribution-data get-validation-exceptions transform-data-service update-participant process-caas-file remove-participant mark-participant-as-eligible demographic-data-management static-validation file-validation add-cohort-distribution-data demographic-data-service update-participant-details create-exception create-participant remove-from-cohort-distribution-data allocate-service-provider "
if [ "$function_list}" == "null" ]; then
if [ "${{steps.get-function-names.outputs.FUNC_NAMES}}" == "null" ]; then
echo "No functions changed"
else
echo "These functions will be rebuilt: " $function_list}
echo "These functions will be rebuilt: " ${{steps.get-function-names.outputs.FUNC_NAMES}}
echo "COMMIT_HASH_TAG:$COMMIT_HASH_TAG"
echo "PR_NUM_TAG:$PR_NUM_TAG"
echo "ENVIRONMENT_TAG:$ENVIRONMENT_TAG"
# Build the docker images via the compose file.
docker compose build $function_list}
docker compose build ${{steps.get-function-names.outputs.FUNC_NAMES}}
fi
- name: push docker images
Expand All @@ -97,13 +95,13 @@ jobs:
function_list="receive-caas-file add-participant lookup-validation mark-participant-as-ineligible retrieve-cohort-distribution-data get-validation-exceptions transform-data-service update-participant process-caas-file remove-participant mark-participant-as-eligible demographic-data-management static-validation file-validation add-cohort-distribution-data demographic-data-service update-participant-details create-exception create-participant allocate-service-provider remove-from-cohort-distribution-data "
echo "ahl 1234"
echo ${function_list}
echo ${{steps.get-function-names.outputs.FUNC_NAMES}}
if [ "${function_list}" == "null" ]; then
if [ "${{steps.get-function-names.outputs.FUNC_NAMES}}" == "null" ]; then
echo "No functions changed"
else
for function in ${function_list}; do
for function in ${{steps.get-function-names.outputs.FUNC_NAMES}}; do
set -x
repo_name="${{ secrets.ACR_NAME }}.azurecr.io/cohort-manager-$function"
Expand Down
50 changes: 9 additions & 41 deletions scripts/deployment/get-docker-names.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,48 +26,16 @@ declare -A docker_functions_map=(

changed_functions=""

# If there are no changed folders, list all functions
if [ -z "$CHANGED_FOLDERS" ]; then
# Concatenate all function names from the map
for folder in "${!docker_functions_map[@]}"; do
changed_functions+=" ${docker_functions_map[$folder]}"
done

# If the shared folder is changed, then all functions may need to be considered
elif [[ $CHANGED_FOLDERS == *"Shared"* ]]; then
for folder in "${!docker_functions_map[@]}"; do
changed_functions+=" ${docker_functions_map[$folder]}"
done
# Otherwise, only process the changed folders
else
# Iterate over changed folders and add corresponding function names
if [ -z $CHANGED_FOLDERS ]; then
changed_functions="null"
elif [[ $CHANGED_FOLDERS == "*Shared*" ]]; then
changed_functions=""
else
for folder in $CHANGED_FOLDERS; do
# Check if the folder exists in the map
if [[ -n "${docker_functions_map[$folder]}" ]]; then
changed_functions+=" ${docker_functions_map[$folder]}"
else
echo "Warning: No function mapped for folder '$folder'"
fi
changed_functions+=" ${docker_functions_map[$folder]}"
done
fi

# Remove leading spaces
changed_functions=$(echo $changed_functions | sed 's/^ //')

# Output the concatenated function names
echo "FUNC_NAMES=$changed_functions" >> "$GITHUB_ENV"


# changed_functions=""
fi

# if [ -z $CHANGED_FOLDERS ]; then
# changed_functions="null"
# elif [[ $CHANGED_FOLDERS == "*Shared*" ]]; then
# changed_functions=""
# else
# for folder in $CHANGED_FOLDERS; do
# changed_functions+=" ${docker_functions_map[$folder]}"
# done
# fi
changed_functions="process-caas-file receive-caas-file create-exception add-cohort-distribution-data remove-from-cohort-distribution-data retrieve-cohort-distribution-data #inconsistant file name for the function allocate-service-provider transform-data-service demographic-data-management remove-participant add-participant update-participant file-validation lookup-validation static-validation demographic-data-service get-validation-exceptions create-participant mark-participant-as-eligible mark-participant-as-ineligible update-participant-details"

# echo "FUNC_NAMES=$changed_functions" >> "$GITHUB_OUTPUT"
echo "FUNC_NAMES=$changed_functions" >> "$GITHUB_OUTPUT"

0 comments on commit dcd029f

Please sign in to comment.