-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add enterpriseDeploy target, closes HYB-514
Motivation: Support new deployment file to create package and simulation Modifications: Add enterpriseDeploy target that call deploy utilities in gatling-plugin-commons
- Loading branch information
1 parent
90a9a70
commit 4d44472
Showing
2 changed files
with
53 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
/* | ||
* Copyright 2011-2022 GatlingCorp (https://gatling.io) | ||
* | ||
* 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.gatling.mojo; | ||
|
||
import io.gatling.plugin.BatchEnterprisePlugin; | ||
import io.gatling.plugin.deployment.DeploymentConfiguration; | ||
import io.gatling.plugin.exceptions.EnterprisePluginException; | ||
import io.gatling.plugin.model.Packager; | ||
import java.io.File; | ||
import org.apache.maven.plugin.MojoFailureException; | ||
import org.apache.maven.plugins.annotations.Execute; | ||
import org.apache.maven.plugins.annotations.Mojo; | ||
import org.apache.maven.plugins.annotations.ResolutionScope; | ||
|
||
@Execute(goal = "enterprisePackage") | ||
@Mojo(name = "enterpriseDeploy", requiresDependencyResolution = ResolutionScope.TEST) | ||
public final class EnterpriseDeployMojo extends AbstractEnterprisePluginMojo { | ||
|
||
@Override | ||
public void execute() throws MojoFailureException { | ||
final File packageFile = enterprisePackage(); | ||
final File deploymentFile = | ||
DeploymentConfiguration.fromBaseDirectory(mavenProject.getBasedir()); | ||
final Boolean isPrivateRepositoryEnabled = controlPlaneUrl != null; | ||
final BatchEnterprisePlugin plugin = initBatchEnterprisePlugin(); | ||
try { | ||
plugin.deployFromDescriptor( | ||
deploymentFile, | ||
packageFile, | ||
mavenProject.getArtifactId(), | ||
isPrivateRepositoryEnabled, | ||
Packager.MAVEN, | ||
getClass().getPackage().getImplementationVersion()); | ||
} catch (EnterprisePluginException e) { | ||
throw new MojoFailureException(e.getMessage(), e); | ||
} | ||
} | ||
} |