A simple tool to install packages from GitHub/GitLab releases or Apache HTTP server. Tested with most of the Prometheus exporters.
- Support private repo
- Support GitLab
- install script
curl -fsSL https://raw.githubusercontent.com/zachcheung/release-installer/main/install.sh | sh
-
go install
go install github.com/zachcheung/release-installer@latest
release-installer [-dir directory] [-exclude pattern] [-pattern asset_pattern] [-provider provider] [-tag tag] [-token token] [-url url] <REPO>
It is recommended to test in a container before installing a package.
docker run --rm ghcr.io/zachcheung/release-installer -dir /tmp [OPTIONS] <REPO>
- Public GitHub Repo
/ # release-installer goreleaser/example
2024/07/15 01:08:46 Downloading example_1.3.0_linux_amd64.tar.gz from https://github.com/goreleaser/example/releases/download/v1.3.0/example_1.3.0_linux_amd64.tar.gz
2024/07/15 01:08:48 Downloaded example_1.3.0_linux_amd64.tar.gz
2024/07/15 01:08:48 Installed example to /usr/local/bin
- Private GitHub Repo
release-installer -token <TOKEN> <PRIVATE_REPO>
The token should have the repo
scope if using Personal access tokens (classic)
.
- Public GitLab Repo
/ # release-installer -provider gitlab goreleaser/example
2024/07/12 08:26:25 Downloading example_2.0.7_linux_amd64.tar.gz from https://gitlab.com/goreleaser/example/-/releases/v2.0.7/downloads/example_2.0.7_linux_amd64.tar.gz
2024/07/12 08:26:25 Downloaded example_2.0.7_linux_amd64.tar.gz
2024/07/12 08:26:25 Installed example to /usr/local/bin
- Private GitLab Repo (in the Self-Repo CI Job)
release-installer -provider gitlab -url $CI_SERVER_URL -token $GITLAB_TOKEN $CI_PROJECT_ID
The GITLAB_TOKEN
should be set and have at least the read_api
scope.
If the value of -url
contains gitlab
, the -provider
can be omitted.
- Apache HTTP Server
release-installer -provider apache -url https://mmonit.com/monit/dist/binary/ -pattern 'linux-x64.tar.gz$' monit
- Exclude Specific Binaries in the Asset
release-installer -exclude '/etc/' syncthing/syncthing
- GitHub
- GitLab
- Apache HTTP Server
Token is required when repo is private.
- gzip
- zip