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

Factorize code of ServerEvaluationStrategy classes, to use the Custom strategy as the basis of other strategies #5366

Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7750516
Pull-up the local docker port management (use exposed ports)
davidfestal Jun 12, 2017
c9a2c42
Make all the strategies extend `CustomEvaluationStrategy`
davidfestal Jun 12, 2017
9d67488
Add a `workspaceIdWithoutPrefix` macro and use it for `single-port`
davidfestal Jun 13, 2017
6efc793
Add the `isDevMachine` to allow conditions in the ST template.
davidfestal Jun 13, 2017
4c2b5cc
Small fixes after comments from @fbenoit
davidfestal Jun 13, 2017
58c5609
Fix unnecessary space pointed out by @sunix
davidfestal Jun 13, 2017
c5a99e6
Remove unnecessary `else` as suggested by @sunix
davidfestal Jun 13, 2017
8addae5
Keep the method signatures compatible with the `condenvy` strategy
davidfestal Jun 13, 2017
0e87138
Align names of parameters of constructors (requested by @garagatyi)
davidfestal Jun 14, 2017
97cc631
Add a default implementation to avoid breaking the Codenvy build
davidfestal Jun 14, 2017
d2c538a
Also rename the attributes
davidfestal Jun 14, 2017
0644a37
Use a constant for the `workspace` prefix string
davidfestal Jun 14, 2017
1325df8
Fix formatting as requested by @sunix
davidfestal Jun 14, 2017
82ed118
Use a constant for the `isDevMachine` macro name
davidfestal Jun 14, 2017
bd07aa8
Add unit tests for `workspaceIdWithoutPrefixè and `isDevMachine` macros
davidfestal Jun 14, 2017
385a108
Another requested formatting fix
davidfestal Jun 14, 2017
5bf33e1
Make new tests clearer
davidfestal Jun 14, 2017
ad629e3
yet another formatting request
davidfestal Jun 14, 2017
1154f57
Respect the original order of imports
davidfestal Jun 14, 2017
b350718
remove unnecessary `toString()`
davidfestal Jun 14, 2017
769ef86
use a lowercase `S` in the `server-` prefix
davidfestal Jun 15, 2017
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
Prev Previous commit
Next Next commit
Use a constant for the workspace prefix string
Signed-off-by: David Festal <dfestal@redhat.com>
  • Loading branch information
davidfestal committed Jun 14, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 0644a37e87897a1e26c966c6b51b4eb2fd31904c
Original file line number Diff line number Diff line change
@@ -62,6 +62,11 @@ public class CustomServerEvaluationStrategy extends ServerEvaluationStrategy {
*/
public static final String CHE_IS_DEV_MACHINE_PROPERTY = "CHE_IS_DEV_MACHINE=";

/**
* Prefix added in front of the generated name to build the workspaceId
*/
public static final String CHE_WORKSPACE_ID_PREFIX = "workspace";

/**
* Used to store the address set by property {@code che.docker.ip}, if applicable.
*/
@@ -397,7 +402,7 @@ protected void populateGlobalProperties() {
globalPropertiesMap.put("externalAddress", externalAddress);
globalPropertiesMap.put("externalIP", externalIP);
globalPropertiesMap.put("workspaceId", getWorkspaceId());
globalPropertiesMap.put("workspaceIdWithoutPrefix", getWorkspaceId().replaceFirst("workspace",""));
globalPropertiesMap.put("workspaceIdWithoutPrefix", getWorkspaceId().replaceFirst(CHE_WORKSPACE_ID_PREFIX,""));
globalPropertiesMap.put("machineName", getMachineName());
globalPropertiesMap.put("wildcardNipDomain", getWildcardNipDomain(externalAddress));
globalPropertiesMap.put("wildcardXipDomain", getWildcardXipDomain(externalAddress));