Skip to content

Commit

Permalink
Merge branch 'main' into tborisova/2734-check-airlock-review-logic-in…
Browse files Browse the repository at this point in the history
…-e2e-tests
  • Loading branch information
tanya-borisova authored Dec 6, 2022
2 parents 1ad1f68 + a06ac27 commit f0d6d5c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ FEATURES:
ENHANCEMENTS:
* Remove Porter's Docker mixin as it's not in use ([#2889](https://github.com/microsoft/AzureTRE/pull/2889))
* Support template version update ([#2908](https://github.com/microsoft/AzureTRE/pull/2908))
* Support updating the firewall when installing via makefile/CICD ([#2942](https://github.com/microsoft/AzureTRE/pull/2942))

BUG FIXES:
* Private endpoints for AppInsights are now provisioning successfully and consistently ([#2841](https://github.com/microsoft/AzureTRE/pull/2841))
Expand Down
2 changes: 1 addition & 1 deletion api_app/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.0"
__version__ = "0.6.1"
4 changes: 2 additions & 2 deletions api_app/api/routes/resource_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def save_and_deploy_resource(
def mask_sensitive_properties(
properties: Dict[str, Any], template: ResourceTemplate
) -> dict:
updated_resource_parameters = properties
updated_resource_parameters = deepcopy(properties)

flattened_template_props = {}

Expand Down Expand Up @@ -113,7 +113,7 @@ def recurse_input_props(prop_dict: dict):
if isinstance(prop, dict):
recurse_input_props(prop)

recurse_input_props(properties)
recurse_input_props(updated_resource_parameters)

return updated_resource_parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ async def test_save_and_deploy_masks_secrets(self, send_deployment_message_mock,

# Checking that the item saved had a secret redacted
resource.properties["secret"] = strings.REDACTED_SENSITIVE_VALUE
resource.properties["prop_with_nested_secret"]["nested_secret"] = strings.REDACTED_SENSITIVE_VALUE

resource_repo.save_item.assert_called_once_with(resource)

def test_sensitive_properties_get_masked(self, basic_resource_template):
Expand Down
44 changes: 28 additions & 16 deletions devops/scripts/deploy_shared_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ fi
deployed_shared_service=$(echo "${get_shared_services_result}" \
| jq -r ".sharedServices[] | select(.templateName == \"${template_name}\" and (.deploymentStatus != \"deleted\" or .deploymentStatus != \"deployment_failed\"))")

is_update=0
if [[ -n "${deployed_shared_service}" ]]; then
# Get template version of the service already deployed
deployed_version=$(echo "${deployed_shared_service}" | jq -r ".templateVersion")
Expand All @@ -59,22 +60,23 @@ if [[ -n "${deployed_shared_service}" ]]; then
echo "Shared service ${template_name} of version ${template_version} has already been deployed"
exit 0
else
echo "Resource upgrade isn't currently implemented. See https://github.com/microsoft/AzureTRE/issues/141"
exit 0
is_update=1
fi
fi

# Add additional properties to the payload JSON string
additional_props=""
for index in "${!property_names[@]}"; do
name=${property_names[$index]}
value=${property_values[$index]}
additional_props="$additional_props, \"$name\": \"$value\""
done
if [[ "${is_update}" -eq 0 ]]; then

# Add additional properties to the payload JSON string
additional_props=""
for index in "${!property_names[@]}"; do
name=${property_names[$index]}
value=${property_values[$index]}
additional_props="$additional_props, \"$name\": \"$value\""
done

echo "Not currently deployed - deploying..."
display_name="${template_name#tre-shared-service-}"
if ! deploy_result=$(cat << EOF | tre shared-services new --definition-file -
echo "Not currently deployed - deploying..."
display_name="${template_name#tre-shared-service-}"
if ! deploy_result=$(cat << EOF | tre shared-services new --definition-file -
{
"templateName": "${template_name}",
"properties": {
Expand All @@ -84,9 +86,19 @@ if ! deploy_result=$(cat << EOF | tre shared-services new --definition-file -
}
}
EOF
); then
echo "Failed to deploy shared service:"
echo "${deploy_result}"
exit 1
); then
echo "Failed to deploy shared service:"
echo "${deploy_result}"
exit 1
fi

else

echo "An older version is already deloyed. Trying to update..."
deployed_id=$(echo "${deployed_shared_service}" | jq -r ".id")
deployed_etag=$(echo "${deployed_shared_service}" | jq -r "._etag")
tre shared-service "${deployed_id}" update --etag "${deployed_etag}" --definition "{\"templateVersion\": \"${template_version}\"}"

fi

echo "Deployed shared service ""${template_name}"""

0 comments on commit f0d6d5c

Please sign in to comment.