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

Change macOS register agent installation script #5481

Merged
merged 2 commits into from
May 23, 2023

Conversation

asteriscos
Copy link
Member

@asteriscos asteriscos commented May 23, 2023

Description

Hi team,

this pull request changes the register agent installation script for macOS. It sets de environment variables to the /tmp/wazuh_envs

Issues Resolved

Closes #5466

Evidence

image

Test

  • Go to the register agents wizard
  • Select macOS
  • With empty fields you should NOT see the echo -e "" > /tmp/wazuh_envs
  • With any filled input you should see echo -e "" > /tmp/wazuh_envs with environmental variables like this:
curl -so wazuh-agent.pkg https://packages.wazuh.com/4.x/macos/wazuh-agent-4.4.3-1.pkg && echo -e "WAZUH_MANAGER='192.168.0.1'\nWAZUH_AGENT_GROUP='default'\nWAZUH_AGENT_NAME='new-agent'\n" > /tmp/wazuh_envs && sudo installer -pkg ./wazuh-agent.pkg -target /

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@asteriscos asteriscos self-assigned this May 23, 2023
@asteriscos asteriscos marked this pull request as ready for review May 23, 2023 10:05
@asteriscos asteriscos requested a review from a team as a code owner May 23, 2023 10:05
@github-actions
Copy link
Contributor

Code coverage (Jest) % values
Statements 8.77% ( 3242 / 36925 )
Branches 4.48% ( 1285 / 28635 )
Functions 7.63% ( 698 / 9146 )
Lines 8.84% ( 3127 / 35360 )

Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

image

image

@asteriscos asteriscos merged commit 3200cc9 into 4.4 May 23, 2023
@asteriscos asteriscos deleted the fix/5202-change-register-agent-macos-command branch May 23, 2023 10:56
@github-actions
Copy link
Contributor

The backport to 4.4-7.16 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.4-7.16 4.4-7.16
# Navigate to the new working tree
cd .worktrees/backport-4.4-7.16
# Create a new branch
git switch --create backport-5481-to-4.4-7.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3200cc9e50d78bc934786edf02625f3ee2a2cdd0
# Push it to GitHub
git push --set-upstream origin backport-5481-to-4.4-7.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.4-7.16

Then, create a pull request where the base branch is 4.4-7.16 and the compare/head branch is backport-5481-to-4.4-7.16.

@github-actions
Copy link
Contributor

The backport to 4.4-7.10 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.4-7.10 4.4-7.10
# Navigate to the new working tree
cd .worktrees/backport-4.4-7.10
# Create a new branch
git switch --create backport-5481-to-4.4-7.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3200cc9e50d78bc934786edf02625f3ee2a2cdd0
# Push it to GitHub
git push --set-upstream origin backport-5481-to-4.4-7.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.4-7.10

Then, create a pull request where the base branch is 4.4-7.10 and the compare/head branch is backport-5481-to-4.4-7.10.

asteriscos added a commit that referenced this pull request May 23, 2023
* Change set environment variables for macOS

* Add changelog

(cherry picked from commit 3200cc9)
asteriscos added a commit that referenced this pull request May 23, 2023
* Change set environment variables for macOS

* Add changelog

(cherry picked from commit 3200cc9)
@asteriscos asteriscos linked an issue May 23, 2023 that may be closed by this pull request
asteriscos added a commit that referenced this pull request May 23, 2023
…5481) (#5483)

* Change macOS register agent installation script (#5481)

* Change set environment variables for macOS

* Add changelog

(cherry picked from commit 3200cc9)

* Update CHANGELOG.md
asteriscos added a commit that referenced this pull request May 23, 2023
…5481) (#5482)

Change macOS register agent installation script (#5481)

* Change set environment variables for macOS

* Add changelog

(cherry picked from commit 3200cc9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent deploy command for macOS
2 participants