-
Notifications
You must be signed in to change notification settings - Fork 814
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
Add DD_VERSION #3091
Open
n0ts
wants to merge
1
commit into
DataDog:master
Choose a base branch
from
n0ts:topic-dd-agent-source
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add DD_VERSION #3091
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,12 @@ else | |
no_start=false | ||
fi | ||
|
||
if [ -n "$DD_VERSION" ]; then | ||
dd_version=$DD_VERSION | ||
else | ||
dd_version= | ||
fi | ||
|
||
if [ ! $apikey ]; then | ||
printf "\033[31mAPI key not available in DD_API_KEY environment variable.\033[0m\n" | ||
exit 1; | ||
|
@@ -133,7 +139,12 @@ if [ $OS = "RedHat" ]; then | |
$sudo_cmd yum -y remove datadog-agent-base | ||
fi | ||
fi | ||
$sudo_cmd yum -y --disablerepo='*' --enablerepo='datadog' install datadog-agent || $sudo_cmd yum -y install datadog-agent | ||
if [ -n "$dd_version" ]; then | ||
dd_agent=datadog-agent-$dd_version | ||
else | ||
dd_agent=datadog-agent | ||
fi | ||
$sudo_cmd yum -y --disablerepo='*' --enablerepo='datadog' install $dd_agent || $sudo_cmd yum -y install $dd_agent | ||
elif [ $OS = "Debian" ]; then | ||
printf "\033[34m\n* Installing apt-transport-https\n\033[0m\n" | ||
$sudo_cmd apt-get update || printf "\033[31m'apt-get update' failed, the script will not install the latest version of apt-transport-https.\033[0m\n" | ||
|
@@ -159,7 +170,12 @@ determine the cause. | |
If the cause is unclear, please contact Datadog support. | ||
***** | ||
" | ||
$sudo_cmd apt-get install -y --force-yes datadog-agent | ||
if [ -n "$dd_version" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
dd_agent=datadog-agent=$dd_version | ||
else | ||
dd_agent=datadog-agent | ||
fi | ||
$sudo_cmd apt-get install -y --force-yes $dd_agent | ||
ERROR_MESSAGE="" | ||
elif [ $OS = "SUSE" ]; then | ||
UNAME_M=$(uname -m) | ||
|
@@ -174,8 +190,13 @@ elif [ $OS = "SUSE" ]; then | |
echo -e "\033[34m\n* Refreshing repositories\n\033[0m" | ||
$sudo_cmd zypper --non-interactive refresh | ||
|
||
if [ -n "$dd_version" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
dd_agent=datadog-agent-$dd_version | ||
else | ||
dd_agent=datadog-agent | ||
fi | ||
echo -e "\033[34m\n* Installing Datadog Agent\n\033[0m" | ||
$sudo_cmd zypper --non-interactive install datadog-agent | ||
$sudo_cmd zypper --non-interactive install $dd_agent | ||
|
||
else | ||
printf "\033[31mYour OS or distribution are not supported by this install script. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What about assigning
dd_agent
variable in the if/else block at line 58?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.
dd_agent like
5.8.5