diff --git a/README.md b/README.md index e4b7bcb..c48d7a9 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ rm -rf gatling-charts-highcharts-bundle-${GATLING_VERSION}/user-files/simulation ``` -5. Add the following two dependencies: +5. Add the following dependencies: ```xml diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml new file mode 100644 index 0000000..2004f3c --- /dev/null +++ b/bitbucket-pipelines.yml @@ -0,0 +1,18 @@ +image: maven:3.3.9 +pipelines: + default: + - step: + caches: + - maven + script: + - mvn -B verify + tags: + v*: + - step: + caches: + - maven + script: + - bash configure-maven.sh + - VERSION=$(echo "$BITBUCKET_TAG" | sed -e 's/^v//') + - mvn versions:set -DnewVersion=$VERSION + - mvn deploy diff --git a/pom.xml b/pom.xml index e82c41b..4c88046 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gatling-aws-maven-plugin - com.ea.gatling + com.fr 1.0.18-SNAPSHOT Gatling AWS Maven Plugin The Gatling AWS Maven plugin takes the pain out of scaling up your Gatling tests. It runs your load test on a configurable number of EC2 instances, aggregates a single load test report, and uploads the results to S3. All EC2 instances are terminated at the end of the test to ensure you are only paying for what you need. @@ -95,21 +95,26 @@ + + + org.kuali.maven.wagons + maven-s3-wagon + 1.2.1 + + release - - deployment - Snapshots - https://oss.sonatype.org/content/repositories/snapshots - - deployment - Staging - https://oss.sonatype.org/service/local/staging/deploy/maven2 + fr-maven-release + s3://maven.flexreceipts.com/release + + fr-maven-snapshot + s3://maven.flexreceipts.com/snapshot + diff --git a/src/main/java/com/ea/gatling/AwsGatlingExecutor.java b/src/main/java/com/ea/gatling/AwsGatlingExecutor.java index de12c71..710a144 100644 --- a/src/main/java/com/ea/gatling/AwsGatlingExecutor.java +++ b/src/main/java/com/ea/gatling/AwsGatlingExecutor.java @@ -33,8 +33,10 @@ public class AwsGatlingExecutor implements Runnable { private final String inheritedGatlingJavaOpts; private final boolean debugOutputEnabled; private final boolean runDetached; + private final String remoteLogfile; + private final boolean getRemoteLogFile; - public AwsGatlingExecutor(final String host,final String sshUser, final File sshPrivateKey, final String testName, final File installScript, final File gatlingSourceDir, final String gatlingSimulation, final File simulationConfig, final File gatlingResourcesDir, final File gatlingLocalResultsDir, final List additionalFiles, final int numInstance, final int instanceCount, final ConcurrentHashMap completedHosts, final String gatlingRoot, final String inheritedGatlingJavaOpts, final boolean debugOutputEnabled, final boolean runDetached) { + public AwsGatlingExecutor(final String host,final String sshUser, final File sshPrivateKey, final String testName, final File installScript, final File gatlingSourceDir, final String gatlingSimulation, final File simulationConfig, final File gatlingResourcesDir, final File gatlingLocalResultsDir, final List additionalFiles, final int numInstance, final int instanceCount, final ConcurrentHashMap completedHosts, final String gatlingRoot, final String inheritedGatlingJavaOpts, final boolean debugOutputEnabled, final boolean runDetached, final boolean getRemoteLogFile, final String remoteLogFile) { this.host = host; this.sshUser = sshUser; this.sshPrivateKey = sshPrivateKey.getAbsolutePath(); @@ -53,6 +55,8 @@ public AwsGatlingExecutor(final String host,final String sshUser, final File ssh this.inheritedGatlingJavaOpts = inheritedGatlingJavaOpts; this.debugOutputEnabled = debugOutputEnabled; this.runDetached = runDetached; + this.remoteLogfile = remoteLogFile; + this.getRemoteLogFile = getRemoteLogFile; } public void runGatlingTest() throws IOException { @@ -131,6 +135,11 @@ private int runProcess(final SshClient.HostInfo hostInfo) throws IOException { this.debugOutputEnabled); SshClient.scpDownload(hostInfo, new SshClient.FromTo("simulation.log", String.format("%s/%s/simulation-%s.log", this.gatlingLocalResultsDir.getAbsolutePath(), this.testName, this.host))); + if(this.getRemoteLogFile) { + this.log("Downloading remote log"); + SshClient.scpDownload(hostInfo, new SshClient.FromTo(remoteLogfile, + String.format("%s/%s/remote-log-%s.log", this.gatlingLocalResultsDir.getAbsolutePath(), this.testName, this.host))); + } } return resultCode; diff --git a/src/main/java/com/ea/gatling/GatlingAwsMojo.java b/src/main/java/com/ea/gatling/GatlingAwsMojo.java index 16bcf5c..bdc2336 100644 --- a/src/main/java/com/ea/gatling/GatlingAwsMojo.java +++ b/src/main/java/com/ea/gatling/GatlingAwsMojo.java @@ -62,6 +62,12 @@ public class GatlingAwsMojo extends BaseAwsMojo { @Parameter(property = "gatling.local.results", defaultValue = "${project.build.directory}/gatling/results") private File gatlingLocalResultsDir; + @Parameter(property = "gatling.remote.log", defaultValue = "gatling-charts-highcharts-bundle-2.1.4/target/logs/logfile.txt") + private String gatlingRemoteLog; + + @Parameter(property = "gatling.remote.download", defaultValue = "false") + private boolean downloadRemoteLog; + @Parameter(property = "gatling.local.home", defaultValue = "${user.home}/gatling/gatling-charts-highcharts-bundle-2.1.4/bin/gatling.sh") private String gatlingLocalHome; @@ -95,6 +101,7 @@ public class GatlingAwsMojo extends BaseAwsMojo { @Parameter(property = "prefer.private.ip.hostnames", defaultValue = "false") private boolean preferPrivateIpHostnames; + /** * When true, this will run Gatling detached, and disconnect from SSH while Gatling is running. Leaves a * file called 'gatling.pid' with the pid of the java process in it. @@ -146,7 +153,9 @@ public void execute() throws MojoExecutionException { this.gatlingRoot, this.gatlingJavaOpts, this.debugOutputEnabled, - this.ec2ExecuteDetached); + this.ec2ExecuteDetached, + this.downloadRemoteLog, + this.gatlingRemoteLog); executor.execute(worker); } executor.shutdown();