-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: update mac install script to download from latest release #141
Conversation
sudo chown -R root:wheel $observeagent_install_dir | ||
|
||
# Initialize the agent config file if it doesn't exist | ||
if [ -f "$observeagent_install_dir/observe-agent.yaml" ]; then | ||
echo "Leaving existing observe-agent.yaml in place." | ||
else | ||
echo "Initializing observe-agent.yaml" | ||
sudo $observeagent_install_dir/observe-agent init-config --token $TOKEN --observe_url $OBSERVE_URL --config_path $observeagent_install_dir/observe-agent.yaml | ||
INIT_FLAGS="--config_path $observeagent_install_dir/observe-agent.yaml --token $TOKEN --observe_url $OBSERVE_URL --host_monitoring::enabled=true" | ||
if [ -n "$LOGS_ENABLED" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are the keys for these args defined? is this just an env var? are we adding another layer/set of config key names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, these are just env vars. I needed some way of getting the args from the connection into the config. Now that you've called attention to this though, I wonder if it's better to switch this to getopts
to be more in line with the windows script. What do you think about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@obs-gh-alexlew for context, we invoke the Windows install script like:
.\install.ps1 -observe_token "{{token}}" -observe_collection_endpoint "{{endpoint}}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated so it now works like:
bash scripts/install_mac.sh --token=hi --observe_url example.com --logs_enabled=true
de537af
to
64e9207
Compare
tmp_dir="/tmp/observe-agent" | ||
|
||
# Parse args | ||
while [ $# -gt 0 ]; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getopts
doesn't work on mac for long options unfortunately, so I had to write out this approximation. It doesn't have all the bells and whistles, but is robust enough for our use case of having users copy/paste commands from the connection portal.
Description
Update mac install script to download from latest release. Now that we have a new release which builds the expected Mac zip, we can finally download and install from GitHub.
Checklist