-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: deploymentMode is now overrided by conf
Related to issue #272
- Loading branch information
1 parent
69949dd
commit a7be271
Showing
7 changed files
with
51 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...nt-annotations/src/main/java/io/dekorate/component/decorator/DeploymentModeDecorator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright 2018 The original authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
**/ | ||
|
||
package io.dekorate.component.decorator; | ||
|
||
import io.dekorate.component.model.ComponentSpecBuilder; | ||
import io.dekorate.component.model.DeploymentMode; | ||
import io.dekorate.kubernetes.decorator.Decorator; | ||
|
||
public class DeploymentModeDecorator extends Decorator<ComponentSpecBuilder> { | ||
|
||
private final DeploymentMode deploymentMode; | ||
|
||
public DeploymentModeDecorator(DeploymentMode deploymentMode) { | ||
this.deploymentMode = deploymentMode; | ||
} | ||
|
||
public void visit(ComponentSpecBuilder spec) { | ||
spec.withDeploymentMode(deploymentMode); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,34 +19,26 @@ | |
import io.dekorate.HandlerFactory; | ||
import io.dekorate.Resources; | ||
import io.dekorate.WithProject; | ||
import io.dekorate.project.Project; | ||
import io.dekorate.project.ApplyProjectInfo; | ||
import io.dekorate.config.ConfigurationSupplier; | ||
import io.dekorate.component.config.ComponentConfig; | ||
import io.dekorate.component.config.EditableComponentConfig; | ||
import io.dekorate.component.config.ComponentConfigBuilder; | ||
import io.dekorate.component.decorator.AddBuildConfigToComponentDecorator; | ||
import io.dekorate.component.decorator.AddEnvToComponentDecorator; | ||
import io.dekorate.component.decorator.AddRuntimeTypeToComponentDecorator; | ||
import io.dekorate.component.decorator.AddRuntimeVersionToComponentDecorator; | ||
import io.dekorate.component.decorator.ExposeServiceDecorator; | ||
import io.dekorate.component.config.EditableComponentConfig; | ||
import io.dekorate.component.decorator.*; | ||
import io.dekorate.component.model.Component; | ||
import io.dekorate.component.model.ComponentBuilder; | ||
import io.dekorate.config.ConfigurationSupplier; | ||
import io.dekorate.kubernetes.config.ConfigKey; | ||
import io.dekorate.kubernetes.config.Configuration; | ||
import io.dekorate.kubernetes.config.Env; | ||
import io.dekorate.kubernetes.configurator.ApplyAutoBuild; | ||
import io.dekorate.project.ApplyProjectInfo; | ||
import io.dekorate.project.Project; | ||
import io.dekorate.utils.Strings; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
|
||
public class ComponentHandler implements HandlerFactory, Handler<ComponentConfig>, WithProject { | ||
public static final ConfigKey<String> RUNTIME_TYPE = new ConfigKey<>("RUNTIME_TYPE", String.class); | ||
public static final ConfigKey<String> RUNTIME_VERSION = new ConfigKey<>("RUNTIME_VERSION", String.class); | ||
// public static final String GITHUB_SSH = "[email protected]:"; | ||
// public static final String GITHUB_HTTPS = "https://github.com/"; | ||
|
||
|
||
private final Resources resources; | ||
|
@@ -112,6 +104,7 @@ private void addVisitors(ComponentConfig config) { | |
if (version != null) { | ||
resources.decorateCustom(ResourceGroup.NAME,new AddRuntimeVersionToComponentDecorator(version)); | ||
} | ||
resources.decorateCustom(ResourceGroup.NAME,new DeploymentModeDecorator(config.getDeploymentMode())); | ||
for (Env env : config.getEnvs()) { | ||
resources.decorateCustom(ResourceGroup.NAME, new AddEnvToComponentDecorator(env)); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters