Skip to content

.gitattribute #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2023
Merged
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
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.tf text eol=lf
*.md text eol=lf diff=markdown
*.template text eol=lf
config text eol=lf
*.yaml text eol=lf
*.sh text eol=lf
* text=auto eol=lf
10 changes: 4 additions & 6 deletions interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ title: "App Stack for Java"
description: |
The App Stack for Java can deploy existing Java applications to serverless Container Instances behind a load balancer in the Oracle Cloud. It supports multiple options: the source code of the application is in DevOps, the application is uploaded as a war or jar, or as a container image.
schemaVersion: 1.1.0
version: "20230607"
version: "v0.1.3"
informationalText: |
For more information and product documentation please visit the <a href="https://github.com/oracle-quickstart/appstack/">App Stack project page</a> .

logoUrl: "https://cloudmarketplace.oracle.com/marketplace/content?contentId=58352039"

source:
type: marketplace
reference: 47726045

locale: "en"

variableGroups:
Expand Down Expand Up @@ -817,7 +815,7 @@ outputGroups:
outputs:
app_url:
type: link
title: Open Application URL
title: Application URL
visible: true


Expand Down
2 changes: 1 addition & 1 deletion output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

output "app_url" {
description = "Application URL : "
value = (var.create_fqdn ? "https://${local.domain_name}" : oci_load_balancer.flexible_loadbalancer.ip_address_details[0].ip_address)
value = (var.create_fqdn ? "https://${local.domain_name}" : "http://${oci_load_balancer.flexible_loadbalancer.ip_address_details[0].ip_address}")
}
21 changes: 12 additions & 9 deletions update_container_instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
# Copyright (c) 2023, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
# drain backend from backend set
OUTPUT=$(oci lb backend update --backend-name $1 --backend-set-name $2 --backup false --drain true --load-balancer-id $3 --offline false --weight 1 --wait-for-state SUCCEEDED --wait-for-state FAILED)
if [[ $OUTPUT == *"FAILED"* ]] ; then
OUTPUT=$(oci lb backend update --backend-name $1 --backend-set-name $2 --backup false --drain true --load-balancer-id $3 --offline false --weight 1 --wait-for-state SUCCEEDED --wait-for-state FAILED | python3 -c "import sys, json; print(json.load(sys.stdin)['data']['lifecycle-state'])" | tr ‘[:lower:]’ ‘[:upper:]’)
echo $OUTPUT
if [ "$OUTPUT" = "FAILED" ] ; then
exit 1
else
echo "load balancer drained backend: $1"
fi

# update backend
OUTPUT=$(oci container-instances container-instance restart --container-instance-id $4 --wait-for-state SUCCEEDED --wait-for-state FAILED)
if [[ $OUTPUT == *"FAILED"* ]] ; then
OUTPUT=$(oci container-instances container-instance restart --container-instance-id $4 --wait-for-state SUCCEEDED --wait-for-state FAILED | python3 -c "import sys, json; print(json.load(sys.stdin)['data']['status'])" | tr ‘[:lower:]’ ‘[:upper:]’)
echo $OUTPUT
if [ "$OUTPUT" = "FAILED" ] ; then
exit 1
else
echo "updated container instance: $4"
Expand All @@ -20,8 +22,9 @@ fi
# wait for container instance to come up again
sleep 30
OUTPUT="FAILED"
echo $OUTPUT
i=0
while [[ $OUTPUT != *"OK"* ]]
while [ "$OUTPUT" != "OK" ]
do
let "i+=1"
if [ $i -gt 30 ]
Expand All @@ -30,16 +33,16 @@ do
exit 1
fi
sleep 10
OUTPUT=$(oci lb backend-health get --backend-name $1 --backend-set-name $2 --load-balancer-id $3)
OUTPUT=$(oci lb backend-health get --backend-name $1 --backend-set-name $2 --load-balancer-id $3 | python3 -c "import sys, json; print(json.load(sys.stdin)['data']['status'])" | tr ‘[:lower:]’ ‘[:upper:]’)
echo $OUTPUT
done

# undrain backend from backend set
OUTPUT=$(oci lb backend update --backend-name $1 --backend-set-name $2 --backup false --drain false --load-balancer-id $3 --offline false --weight 1 --wait-for-state SUCCEEDED --wait-for-state FAILED)
OUTPUT=$(oci lb backend update --backend-name $1 --backend-set-name $2 --backup false --drain false --load-balancer-id $3 --offline false --weight 1 --wait-for-state SUCCEEDED --wait-for-state FAILED | python3 -c "import sys, json; print(json.load(sys.stdin)['data']['lifecycle-state'])" | tr ‘[:lower:]’ ‘[:upper:]’)
echo $OUTPUT
if [[ $OUTPUT == *"FAILED"* ]] ; then
if [ "$OUTPUT" = "FAILED" ] ; then
exit 1
else
echo "load balancer undrained backend: $1"
fi
exit 0
exit 0