Skip to content
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

make the ephemeral startup configurable for users #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

HarshCasper
Copy link
Member

No description provided.

@HarshCasper HarshCasper requested a review from lukqw August 9, 2024 15:30
Copy link

github-actions bot commented Aug 9, 2024

The ephemeral instance for the application preview has been shut down

@HarshCasper HarshCasper force-pushed the config-option branch 8 times, most recently from 5f60e10 to d20755a Compare August 9, 2024 16:13
Copy link
Member

@lukqw lukqw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome that we're building this!
Added a first set of comments.

@@ -23,7 +23,10 @@ inputs:
description: 'The lifetime of the ephemeral instance, how long the instance should be available for'
required: false
default: '30'

ephemeral-configuration:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make more sense to keep this as configuration, similar to what we have in place over in the normal startup action? link: https://github.com/localstack/setup-localstack/blob/main/startup/action.yml

If not, then you'd also have to reflect this argument in the README.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Furthermore this would have to be added in the main action: https://github.com/localstack/setup-localstack/blob/main/action.yml#L138

Comment on lines +76 to +89
configuration="${{ inputs.ephemeral-configuration }}"
echo "Creating preview environment with configuration: $configuration"
# Convert configuration to JSON format
IFS=',' read -r -a configArray <<< "$configuration"
envVarsJson=$(jq -n '{}')
for config in "${configArray[@]}"; do
IFS='=' read -r -a kv <<< "$config"
key=${kv[0]// /}
value=${kv[1]// /}
envVarsJson=$(echo $envVarsJson | jq --arg key "$key" --arg value "$value" '. + {($key): $value}')
done
echo "Configuration JSON: $envVarsJson"

envVarsJson=$(echo $envVarsJson | jq --arg autoLoadPod "$autoLoadPod" --arg extensionAutoInstall "$extensionAutoInstall" '. + {AUTO_LOAD_POD: $autoLoadPod, EXTENSION_AUTO_INSTALL: $extensionAutoInstall}')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is oddly convoluted, is there a way we could improve readability and maintenance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants