Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.15] Fix order of operations in instructions. (#195503) #195605

Merged
merged 1 commit into from
Oct 9, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--x86_64.rpm
sudo rpm -vi elastic-agent--x86_64.rpm
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});

Expand All @@ -93,12 +93,12 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--amd64.deb
sudo dpkg -i elastic-agent--amd64.deb
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});

Expand Down Expand Up @@ -199,13 +199,13 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--x86_64.rpm
sudo rpm -vi elastic-agent--x86_64.rpm
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});

Expand All @@ -220,13 +220,13 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--amd64.deb
sudo dpkg -i elastic-agent--amd64.deb
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});
});
Expand Down Expand Up @@ -356,6 +356,8 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--x86_64.rpm
sudo rpm -vi elastic-agent--x86_64.rpm
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll --url=http://fleetserver:8220 \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
Expand All @@ -364,9 +366,7 @@ describe('getInstallCommandForPlatform', () => {
--fleet-server-es-ca=<PATH_TO_ES_CERT> \\\\
--fleet-server-cert=<PATH_TO_FLEET_SERVER_CERT> \\\\
--fleet-server-cert-key=<PATH_TO_FLEET_SERVER_CERT_KEY> \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});

Expand All @@ -383,6 +383,8 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--amd64.deb
sudo dpkg -i elastic-agent--amd64.deb
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll --url=http://fleetserver:8220 \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
Expand All @@ -391,9 +393,7 @@ describe('getInstallCommandForPlatform', () => {
--fleet-server-es-ca=<PATH_TO_ES_CERT> \\\\
--fleet-server-cert=<PATH_TO_FLEET_SERVER_CERT> \\\\
--fleet-server-cert-key=<PATH_TO_FLEET_SERVER_CERT_KEY> \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export function getInstallCommandForPlatform(
linux: `${artifact.downloadCommand}\nsudo ./elastic-agent install ${commandArgumentsStr}`,
mac: `${artifact.downloadCommand}\nsudo ./elastic-agent install ${commandArgumentsStr}`,
windows: `${artifact.downloadCommand}\n.\\elastic-agent.exe install ${commandArgumentsStr}`,
deb: `${artifact.downloadCommand}\nsudo elastic-agent enroll ${commandArgumentsStr}\nsudo systemctl enable elastic-agent\nsudo systemctl start elastic-agent`,
rpm: `${artifact.downloadCommand}\nsudo elastic-agent enroll ${commandArgumentsStr}\nsudo systemctl enable elastic-agent\nsudo systemctl start elastic-agent`,
deb: `${artifact.downloadCommand}\nsudo systemctl enable elastic-agent\nsudo systemctl start elastic-agent\nsudo elastic-agent enroll ${commandArgumentsStr}`,
rpm: `${artifact.downloadCommand}\nsudo systemctl enable elastic-agent\nsudo systemctl start elastic-agent\nsudo elastic-agent enroll ${commandArgumentsStr}`,
kubernetes: '',
cloudFormation: '',
googleCloudShell: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ cd elastic-agent-${agentVersion}-windows-x86_64

const linuxDebCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-amd64.deb
sudo dpkg -i elastic-agent-${agentVersion}-amd64.deb
sudo elastic-agent enroll ${enrollArgs} \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`;
sudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent \nsudo elastic-agent enroll ${enrollArgs} \n`;

const linuxRpmCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-x86_64.rpm
sudo rpm -vi elastic-agent-${agentVersion}-x86_64.rpm
sudo elastic-agent enroll ${enrollArgs} \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`;
sudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent \nsudo elastic-agent enroll ${enrollArgs} \n`;

const googleCloudShellCommand = `gcloud config set project ${gcpProjectId} && ${
gcpAccountType === 'organization-account' ? `ORG_ID=${gcpOrganizationId}` : ``
Expand Down
Loading