Skip to content

Commit a3f1697

Browse files
authored
Merge pull request #2589 from newrelic/remove-deployment-marker
Remove deployment marker function
2 parents 480f69d + dec398b commit a3f1697

File tree

3 files changed

+1
-105
lines changed

3 files changed

+1
-105
lines changed

newrelic-agent/src/main/java/com/newrelic/agent/AgentCommandLineParser.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.util.Map.Entry;
2929

3030
class AgentCommandLineParser {
31-
private static final String DEPLOYMENT_COMMAND = "deployment";
3231
private static final String VERIFY_INSTRUMENTATION = "verifyInstrumentation";
3332
/**
3433
* Used to create the custom instrumentation file.
@@ -39,13 +38,10 @@ class AgentCommandLineParser {
3938

4039
static {
4140
commandOptionsMap = new HashMap<>();
42-
commandOptionsMap.put(DEPLOYMENT_COMMAND, getDeploymentOptions());
4341
commandOptionsMap.put(INSTRUMENT_COMMAND, getInstrumentOptions());
4442
commandOptionsMap.put(VERIFY_INSTRUMENTATION, getVerifyInstrumentationOptions());
4543

4644
commandDescriptions = new HashMap<>();
47-
commandDescriptions.put(DEPLOYMENT_COMMAND, "[OPTIONS] [description] Records a deployment. Note: This command is deprecated and will be removed " +
48-
"in the next major release.");
4945
commandDescriptions.put(INSTRUMENT_COMMAND, "[OPTIONS] Validates a custom instrumentation xml configuration file.");
5046
}
5147

@@ -72,9 +68,7 @@ public void parseCommand(String[] args) {
7268
cmd = parser.parse(commandOptions, args);
7369
}
7470

75-
if (DEPLOYMENT_COMMAND.equals(command)) {
76-
deploymentCommand(cmd);
77-
} else if (INSTRUMENT_COMMAND.equals(command)) {
71+
if (INSTRUMENT_COMMAND.equals(command)) {
7872
instrumentCommand(cmd);
7973
} else if (VERIFY_INSTRUMENTATION.equals(command)) {
8074
verifyInstrumentation(cmd);
@@ -176,16 +170,6 @@ private static Options getBasicOptions() {
176170
return options;
177171
}
178172

179-
private static Options getDeploymentOptions() {
180-
Options options = new Options();
181-
options.addOption(Deployments.APP_NAME_OPTION, true, "Set the application name. Default is app_name setting in newrelic.yml");
182-
options.addOption(Deployments.ENVIRONMENT_OPTION, true, "Set the environment (staging, production, test, development)");
183-
options.addOption(Deployments.USER_OPTION, true, "Specify the user deploying");
184-
options.addOption(Deployments.REVISION_OPTION, true, "Specify the revision being deployed");
185-
options.addOption(Deployments.CHANGE_LOG_OPTION, false, "Reads the change log for a deployment from standard input");
186-
return options;
187-
}
188-
189173
/**
190174
* Returns the instrumentation options.
191175
*

newrelic-agent/src/test/java/com/newrelic/agent/AgentCommandLineParserTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@ public void parseCommand_withHelpOptionAndCommand_printsHelpText() {
5555
Assert.assertTrue(replacementOut.toString().contains("java -jar newrelic.jar"));
5656
}
5757

58-
@Test
59-
public void parseCommand_withDeploymentOption_callsRecordDeployment() {
60-
String[] args = new String[] { "deployment" };
61-
AgentCommandLineParser parser = new AgentCommandLineParser();
62-
63-
try (MockedStatic<Deployments> deploymentsMock = Mockito.mockStatic(Deployments.class)) {
64-
parser.parseCommand(args);
65-
deploymentsMock.verify(() -> Deployments.recordDeployment(Mockito.any()));
66-
}
67-
}
68-
6958
@Test
7059
public void parseCommand_withInstrumentOption_callsValidateInstrumentation() {
7160
String[] args = new String[] { "instrument" };

newrelic-agent/src/test/java/com/newrelic/agent/DeploymentsTest.java

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)