-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit contains the files and the scripts which are necessary to build, package, and publish the LogDNA Agent for Linux, Win32 and Mac Systems. Some parts have been taken from [Gruntfile](https://github.com/logdna/logdna-agent/blob/master/Gruntfile.js) and some have been taken from the internal instances. Semver: patch Ref: LOG-5336, LOG-5337, LOG-5338, LOG-5339
- Loading branch information
Showing
25 changed files
with
667 additions
and
98 deletions.
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2020 LogDNA | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# How to Build | ||
|
||
## Requirements | ||
- Update the [`CHANGELOG`](../CHANGELOG.md) | ||
- Update the `version` in [`package.json`](../package.json#L3) | ||
- Update the `version` in [`logdna-agent.rb`](./files/darwin/logdna-agent.rb#L2) | ||
- Update the `version` in [`logdna-agent.nuspec`](./files/win32/logdna-agent.nuspec#L7) | ||
|
||
## LogDNA Agent for Debian Systems | ||
LogDNA Agent can be built and released for Debian systems by running the `scripts/debian.sh` script: | ||
`bash tools/scripts/debian.sh` | ||
|
||
### Dependencies | ||
- `Node.js: v8.3.0` and `NPM: v5.3.0` | ||
- `NEXE: v3.3.3` by `npm install -g [email protected]` | ||
- `fpm` by `sudo gem install --no-document fpm` | ||
- `ghr` by `go get -u github.com/tcnksm/ghr` | ||
- `deb-s3` by `sudo gem install deb-s3` | ||
|
||
### Environment Variables | ||
- `AWS_ACCESS_KEY` | ||
- `AWS_SECRET_KEY` | ||
- `GITHUB_API_TOKEN` | ||
|
||
### Steps | ||
1. Compile the source code into the executable | ||
2. Package the executable into the Debian package | ||
3. Create / Update the GitHub Release for the specified tag by uploading the Debian package | ||
4. Publish the Debian package into the specified S3 bucket | ||
|
||
## LogDNA Agent for RedHat Systems | ||
LogDNA Agent can be built and released for RedHat systems by running the `scripts/redhat.sh` script from the project directory: | ||
`bash tools/scripts/redhat.sh` | ||
|
||
### Dependencies | ||
- `Node.js: v8.3.0` and `NPM: v5.3.0` | ||
- `NEXE: v3.3.3` by `npm install -g [email protected]` | ||
- `fpm` by `sudo gem install --no-document fpm` | ||
- `ghr` by `go get -u github.com/tcnksm/ghr` | ||
- `rpm-s3` by `git clone https://github.com/crohr/rpm-s3 --recurse-submodules` | ||
|
||
### Environment Variables | ||
- `AWS_ACCESS_KEY` | ||
- `AWS_SECRET_KEY` | ||
- `GITHUB_API_TOKEN` | ||
|
||
### Steps | ||
1. Compile the source code into the executable | ||
2. Package the executable into the RedHat package | ||
3. Create / Update the GitHub Release for the specified tag by uploading the RedHat package | ||
4. Publish the RedHat package into the specified S3 bucket | ||
|
||
## LogDNA Agent for Darwin Systems | ||
LogDNA Agent can be built and released for Darwin systems by running the `scripts/darwin.sh` script from the project directory: | ||
`bash tools/scripts/darwin.sh` | ||
|
||
### Dependencies | ||
- `Node.js: v8.3.0` and `NPM: v5.3.0` | ||
- `NEXE: v3.3.3` by `npm install -g [email protected]` | ||
- `fpm` by `sudo gem install --no-document fpm` | ||
- `ghr` by `brew install ghr` | ||
|
||
### Environment Variables | ||
- `GITHUB_API_TOKEN` | ||
|
||
### Steps | ||
1. Compile the source code into the executable | ||
2. Package the executable into the MacOSX package | ||
3. Create / Update the GitHub Release for the specified tag by uploading the MacOSX package | ||
4. Sign the MacOSX package using the private keychain | ||
5. Publish the MacOSX package by creating a Pull Request to update [logdna-agent.rb](https://github.com/Homebrew/homebrew-cask/blob/master/Casks/logdna-agent.rb) using [logdna-bot/homebrew-cask](https://github.com/logdnabot/homebrew-cask) | ||
|
||
## LogDNA Agent for Win32 Systems | ||
LogDNA Agent can be built and released for Win32 systems by running the `scripts/win32.sh` script from the project directory: | ||
`./tools/scripts/win32.sh` | ||
|
||
### Dependencies | ||
- `choco` by `iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))` on `PowerShell` | ||
- `nssm` by `choco install -y nssm` | ||
- `Node.js: v8.3.0` and `NPM: v5.3.0` by `choco install nodejs --version=8.3.0` | ||
- `NEXE: v3.3.3` by `npm install -g [email protected]` | ||
- `ghr` by `go get -u github.com/tcnksm/ghr` | ||
|
||
### Environment Variables | ||
- `GITHUB_API_TOKEN` | ||
- `CHOCO_API_KEY` | ||
|
||
### Steps | ||
1. Compile the source code into the executable | ||
2. Package the executable into the NuPKG package | ||
3. Create / Update the GitHub Release for the specified tag by uploading the NuPKG package | ||
4. Publish the NuPKG package into [Chocolatey](https://chocolatey.org/packages/logdna-agent) |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Disabled</key> | ||
<true/> | ||
<key>KeepAlive</key> | ||
<true/> | ||
<key>Label</key> | ||
<string>com.logdna.logdna-agentd</string> | ||
<key>ProgramArguments</key> | ||
<array> | ||
<string>/usr/local/bin/logdna-agent</string> | ||
</array> | ||
<key>RunAtLoad</key> | ||
<true/> | ||
<key>StandardErrorPath</key> | ||
<string>/Library/Logs/logdna-agent.log</string> | ||
<key>StandardOutPath</key> | ||
<string>/Library/Logs/logdna-agent.log</string> | ||
</dict> | ||
</plist> |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
cask 'logdna-agent' do | ||
version '1.6.2' | ||
sha256 '350956cbeddf0f0b1cf991a58d659e2a4c2344b621370e10c8adb950f9c6bc47' | ||
|
||
# github.com/logdna/logdna-agent was verified as official when first introduced to the cask | ||
url "https://github.com/logdna/logdna-agent/releases/download/#{version}/logdna-agent-#{version}.pkg" | ||
appcast 'https://github.com/logdna/logdna-agent/releases.atom' | ||
name 'LogDNA Agent' | ||
homepage 'https://logdna.com/' | ||
|
||
pkg "logdna-agent-#{version}.pkg" | ||
|
||
uninstall pkgutil: 'com.logdna.logdna-agent', | ||
launchctl: 'com.logdna.logdna-agentd' | ||
|
||
caveats <<~EOS | ||
When you first start logdna-agent, you must set your LogDNA API key with the command: | ||
sudo logdna-agent -k <api-key> | ||
To always run logdna-agent in the background, use the command: | ||
sudo launchctl load -w /Library/LaunchDaemons/com.logdna.logdna-agent.plist | ||
EOS | ||
end |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
sudo chown root:wheel /Library/LaunchDaemons/com.logdna.logdna-agent.plist | ||
sudo chmod 644 /Library/LaunchDaemons/com.logdna.logdna-agent.plist |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
if sudo /bin/launchctl list com.logdna.logdna-agentd &> /dev/null; then | ||
sudo /bin/launchctl unload "/Library/LaunchDaemons/com.logdna.logdna-agent.plist" | ||
fi | ||
|
||
sudo pkill -f logdna-agent | ||
|
||
( cd / ; sudo pkgutil --only-files --files com.logdna.logdna-agent | tr '\n' '\0' | xargs -n 1 -0 sudo rm -if ) | ||
sudo pkgutil --forget com.logdna.logdna-agent |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/init.d/logdna-agent restart |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/init.d/logdna-agent stop |
Oops, something went wrong.