-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When new Helm goals will be written, this class will serve as a base class. Previously, the HelmMojo class served as both a Helm goal and a base class for other Helm goals (like helm-push and helm-lint). Signed-off-by: Jurrie Overgoor <eclipse.org@jurr.org>
- Loading branch information
Showing
11 changed files
with
133 additions
and
119 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
62 changes: 62 additions & 0 deletions
62
...ugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/AbstractHelmMojo.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,62 @@ | ||
/* | ||
* Copyright (c) 2019 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at: | ||
* | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.jkube.maven.plugin.mojo.build; | ||
|
||
import static org.eclipse.jkube.kit.resource.helm.HelmServiceUtil.initHelmConfig; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import org.apache.maven.plugin.MojoFailureException; | ||
import org.apache.maven.plugins.annotations.Parameter; | ||
import org.eclipse.jkube.kit.resource.helm.HelmConfig; | ||
|
||
public abstract class AbstractHelmMojo extends AbstractJKubeMojo { | ||
|
||
/** | ||
* One of: | ||
* <ul> | ||
* <li>A directory containing OpenShift Templates to use as Helm parameters.</li> | ||
* <li>A file containing a Kubernetes List with OpenShift Template entries to be used as Helm parameters.</li> | ||
* </ul> | ||
*/ | ||
@Parameter(property = "jkube.kubernetesTemplate", defaultValue = "${basedir}/target/classes/META-INF/jkube/kubernetes") | ||
File kubernetesTemplate; | ||
|
||
@Parameter | ||
HelmConfig helm; | ||
|
||
@Override | ||
public void init() throws MojoFailureException { | ||
super.init(); | ||
|
||
try { | ||
helm = initHelmConfig(getDefaultHelmType(), javaProject, getKubernetesTemplate(), helm).build(); | ||
} catch (IOException e) { | ||
throw new MojoFailureException(e.getMessage(), e); | ||
Check warning on line 47 in kubernetes-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/AbstractHelmMojo.java
|
||
} | ||
} | ||
|
||
protected File getKubernetesTemplate() { | ||
return kubernetesTemplate; | ||
} | ||
|
||
protected HelmConfig.HelmType getDefaultHelmType() { | ||
return HelmConfig.HelmType.KUBERNETES; | ||
} | ||
|
||
protected HelmConfig getHelm() { | ||
return helm; | ||
} | ||
} |
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
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
Oops, something went wrong.