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

GH-213: enhance WorkspaceUtil to also search in envrionment variables #214

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

nicdard
Copy link
Collaborator

@nicdard nicdard commented Jan 31, 2024

See: #213

Description

As described in the issue, added the possibility to get the configuration for the Workspace from environment variables, which makes it easier to use.

Related Issue

#213

Motivation and Context

Enable the usage of environment variables in docker containers where an entrypoint is defined in exec form, passing the configurations through ENV variables without the need to bind them using the system properties, which turns out to be really cumbersome.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@@ -28,7 +28,7 @@ public class FeignPublishServiceTestDrive {

public static void main(String[] args) {
try {
Workspace workspace = WorkspaceUtil.getSystemWorkspaceBuilder().build();
Workspace workspace = WorkspaceUtil.getWorkspaceBuilder().build();
String providerId = WorkspaceUtil.getSystemProperty(AIO_PROVIDER_ID);
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't you want to load these other AIO_* property using the same pattern ? and augment getSystemProperty with System.getEnv() ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah sure!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -28,7 +28,7 @@ public class FeignPublishServiceTestDrive {

public static void main(String[] args) {
try {
Workspace workspace = WorkspaceUtil.getSystemWorkspaceBuilder().build();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would favor keeping the same interface/method-name

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok I'll revert back the change

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@francoisledroff francoisledroff merged commit 4a53673 into adobe:GH-213 Feb 1, 2024
1 check passed
@nicdard nicdard deleted the GH-213 branch February 2, 2024 13:24
francoisledroff added a commit that referenced this pull request Feb 12, 2024
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