Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Added 'skip' options to goals. #1471

Merged
merged 1 commit into from
Jan 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ After this we will switch probably to real [Semantic Versioning 2.0.0](http://se
* Fix 1460: Upgraded kubernetes client to 4.1.1
* Fix 690: Removes deprecated _legacyPortMapping_ property.
* Fix 1458: Support for from Image configuration in openshift docker build strategy
* Fix 732: Added 'skip' options to goals.

### 4.0.0-M2 (2018-12-14)
* Fix 10: Make VolumeConfiguration more flexible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,16 @@ public class ApplyMojo extends AbstractFabric8Mojo {
@Parameter(property = "fabric8.s2i.buildNameSuffix", defaultValue = "-s2i")
protected String s2iBuildNameSuffix;

@Parameter(property = "fabric8.skip.apply", defaultValue = "false")
protected boolean skipApply;
devang-gaur marked this conversation as resolved.
Show resolved Hide resolved

private ClusterAccess clusterAccess;
protected ApplyService applyService;

public void executeInternal() throws MojoExecutionException {
if (skipApply) {
return;
}

clusterAccess = new ClusterAccess(getClusterConfiguration());

Expand Down Expand Up @@ -649,4 +655,4 @@ protected MavenProject getRootProject() {
return project;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ public class BuildMojo extends io.fabric8.maven.docker.BuildMojo {
@Parameter(property = "fabric8.build.recreate", defaultValue = "none")
private String buildRecreate;

@Parameter(property = "docker.skip.build", defaultValue = "false")
protected boolean skipBuild;

@Component
private MavenProjectHelper projectHelper;

Expand Down Expand Up @@ -215,6 +218,10 @@ protected boolean isDockerAccessRequired() {

@Override
protected void executeInternal(ServiceHub hub) throws MojoExecutionException {
if (skipBuild) {
return;
}

try {
if (shouldSkipBecauseOfPomPackaging()) {
getLog().info("Disabling docker build for pom packaging");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,17 @@ public class PushMojo extends io.fabric8.maven.docker.PushMojo {
@Parameter(property = "fabric8.build.strategy" )
private OpenShiftBuildStrategy buildStrategy = OpenShiftBuildStrategy.s2i;

@Parameter(property = "docker.skip.push", defaultValue = "false")
protected boolean skipPush;

@Override
protected String getLogPrefix() {
return "F8> ";
}

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (skip) {
if (skip || skipPush) {
return;
}
super.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ public class ResourceMojo extends AbstractFabric8Mojo {
@Parameter(property = "kompose.dir", defaultValue = "${user.home}/.kompose/bin")
private File komposeBinDir;

@Parameter(property = "docker.skip.resource", defaultValue = "false")
protected boolean skipResource;

// Access for creating OpenShift binary builds
private ClusterAccess clusterAccess;

Expand Down Expand Up @@ -427,6 +430,10 @@ private static File writeResource(File resourceFileBase, Object entity, Resource
}

public void executeInternal() throws MojoExecutionException, MojoFailureException {
if (skipResource) {
return;
}

realResourceDir = ResourceDirCreator.getFinalResourceDir(resourceDir, environment);
realResourceDirOpenShiftOverride = ResourceDirCreator.getFinalResourceDir(resourceDirOpenShiftOverride, environment);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
package io.fabric8.maven.plugin.mojo.develop;

import io.fabric8.maven.plugin.mojo.build.ApplyMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.plugins.annotations.Parameter;

/**
* This goal forks the install goal then applies the generated kubernetes resources to the current cluster.
Expand All @@ -32,4 +34,16 @@

@Mojo(name = "deploy", requiresDependencyResolution = ResolutionScope.COMPILE, defaultPhase = LifecyclePhase.VALIDATE)
@Execute(phase = LifecyclePhase.INSTALL)
public class DeployMojo extends ApplyMojo { }
public class DeployMojo extends ApplyMojo {
@Parameter(property = "docker.skip.deploy", defaultValue = "false")
protected boolean skipDeploy;

@Override
public void executeInternal() throws MojoExecutionException {
if (skipDeploy) {
return;
}

super.executeInternal();
}
}