Skip to content

Commit

Permalink
Amtool (#271)
Browse files Browse the repository at this point in the history
* update: addition of amtool

* update: addition of amtool

* update: amtool build fixes

* update: amtool build fixes

* update: amtool apk build

* fix: add amtool to auto-label

* fix: Makefile fix?

* fix: Makefile auto-label

* update: readme update

* update: auto-label space update
  • Loading branch information
zloeber authored and osterman committed Nov 29, 2019
1 parent 489174e commit 7e44b82
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/auto-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ scripts:
- bin/**
- tasks/**
vendor: vendor/**
vendor/amtool: vendor/amtool/**
vendor/assume-role: vendor/assume-role/**
vendor/atlantis: vendor/atlantis/**
vendor/awless: vendor/awless/**
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,29 @@ packages/uninstall/%:
### Contributing Additional Packages
In addition to following the Contributing section, the following steps can be used to add new packages for review (via a PR).
1. Clone an existing, similar, package within the vendors directory. Name the new folder with the same name as the binary package being installed.
2. At a minimum, update the `VERSION`, `DESCRIPTION`, and `Makefile` to reflect the binary being installed. Ensure that a test section exists and works.
2. At a minimum, update the `VERSION`, `DESCRIPTION`, and `Makefile` to reflect the binary being installed. Ensure that a test task exist in the package Makefile.
3. Test the install and ensure that it downloads and runs as expected (`make -C install <your_package> INSTALL_PATH=/tmp`)
4. Test the build (`make all`)
5. Update the `README.md` (`make readme/build`)
4. Test the apk build (see below)
5. Update the `README.md` (`make init readme/deps readme`)

### Testing apk builds

To validate that a new package will build into an apk you can use the following steps;

```bash
make docker/build/apk/shell
make -C vendor/<appname> apk
# Some temp build files in the volume mount set user/group to nobody/nobody for apk building.
# It is easier to remove them while within the docker container.
rm -rf ./tmp/build.*
exit
```



## Makefile Targets
```
amtool 0.19.0 Tool for interacting with the Alertmanager API
assume-role 0.3.2 Easily assume AWS roles in your terminal.
atlantis 0.10.2 Terraform For Teams
awless 0.1.11 A Mighty CLI for AWS
Expand Down
19 changes: 16 additions & 3 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,24 @@ examples: |-
### Contributing Additional Packages
In addition to following the Contributing section, the following steps can be used to add new packages for review (via a PR).
1. Clone an existing, similar, package within the vendors directory. Name the new folder with the same name as the binary package being installed.
2. At a minimum, update the `VERSION`, `DESCRIPTION`, and `Makefile` to reflect the binary being installed. Ensure that a test section exists and works.
2. At a minimum, update the `VERSION`, `DESCRIPTION`, and `Makefile` to reflect the binary being installed. Ensure that a test task exist in the package Makefile.
3. Test the install and ensure that it downloads and runs as expected (`make -C install <your_package> INSTALL_PATH=/tmp`)
4. Test the build (`make all`)
5. Update the `README.md` (`make readme/build`)
4. Test the apk build (see below)
5. Update the `README.md` (`make init readme/deps readme`)
### Testing apk builds
To validate that a new package will build into an apk you can use the following steps;
```bash
make docker/build/apk/shell
make -C vendor/<appname> apk
# Some temp build files in the volume mount set user/group to nobody/nobody for apk building.
# It is easier to remove them while within the docker container.
rm -rf ./tmp/build.*
exit
```
# Contributors to this project
contributors:
- name: "Erik Osterman"
Expand Down
1 change: 1 addition & 0 deletions docs/targets.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Makefile Targets
```
amtool 0.19.0 Tool for interacting with the Alertmanager API
assume-role 0.3.2 Easily assume AWS roles in your terminal.
atlantis 0.10.2 Terraform For Teams
awless 0.1.11 A Mighty CLI for AWS
Expand Down
1 change: 1 addition & 0 deletions vendor/amtool/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Tool for interacting with the Alertmanager API
1 change: 1 addition & 0 deletions vendor/amtool/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Apache 2.0
17 changes: 17 additions & 0 deletions vendor/amtool/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export VENDOR ?= prometheus
export APK_BUILD_TEMPLATE ?= APKBUILD.github-binary
#export APKBUILD_DEPENDS += libc6-compat musl
export PACKAGE_REPO_NAME = alertmanager
export DOWNLOAD_URL ?= $(PACKAGE_REPO_URL)/releases/download/v$(PACKAGE_VERSION)/alertmanager-$(PACKAGE_VERSION).$(OS)-$(ARCH).tar.gz

include ../../tasks/Makefile.package
include ../../tasks/Makefile.apk

install:
$(call download_tarball)

test:
$(PACKAGE_EXE) --version

package/prepare::
mv src/alertmanager-$(PACKAGE_VERSION).$(OS)-$(ARCH)/$(PACKAGE_EXE) src
1 change: 1 addition & 0 deletions vendor/amtool/RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
1 change: 1 addition & 0 deletions vendor/amtool/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.19.0

0 comments on commit 7e44b82

Please sign in to comment.