Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 51cf46b

Browse files
committed
Merge branch 'manual-pip-install' into 'master'
Manual pip install See merge request ix.ai/alertmanager-notifier!22
2 parents 374b38d + a3acf41 commit 51cf46b

File tree

3 files changed

+51
-15
lines changed

3 files changed

+51
-15
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ variables:
55
ENABLE_ARM64: 'true'
66
ENABLE_ARMv7: 'true'
77
ENABLE_ARMv6: 'true'
8+
ENABLE_386: 'true'
89

910
include:
1011
- project: 'ix.ai/ci-templates'

Dockerfile

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,47 @@
1+
FROM alpine:latest as builder
2+
3+
COPY alertmanager-notifier/requirements.txt /work/alertmanager-notifier/requirements.txt
4+
5+
ENV CRYPTOGRAPHY_DONT_BUILD_RUST="1"
6+
7+
RUN set -xeu; \
8+
mkdir -p /work/wheels; \
9+
apk add \
10+
python3-dev \
11+
openssl-dev \
12+
gcc \
13+
musl-dev \
14+
libffi-dev \
15+
make \
16+
openssl-dev \
17+
cargo \
18+
; \
19+
python3 -m ensurepip; \
20+
pip3 install -U \
21+
wheel \
22+
pip
23+
24+
RUN pip3 wheel --prefer-binary -r /work/alertmanager-notifier/requirements.txt -w /work/wheels
25+
126
FROM alpine:latest
27+
228
LABEL maintainer="[email protected]" \
329
ai.ix.repository="ix.ai/alertmanager-notifier"
430

5-
COPY alertmanager-notifier/requirements.txt /alertmanager-notifier/requirements.txt
31+
COPY --from=builder /work /
632

7-
RUN apk --no-cache upgrade && \
8-
apk --no-cache add python3 py3-pip py3-waitress py3-flask py3-cryptography && \
9-
pip3 install --no-cache-dir -r /alertmanager-notifier/requirements.txt
33+
RUN set -xeu; \
34+
ls -lashi /wheels; \
35+
apk add --no-cache python3; \
36+
python3 -m ensurepip; \
37+
pip3 install --no-cache-dir -U pip;\
38+
pip3 install \
39+
--no-index \
40+
--no-cache-dir \
41+
--find-links /wheels \
42+
--requirement /alertmanager-notifier/requirements.txt \
43+
; \
44+
rm -rf /wheels
1045

1146
COPY alertmanager-notifier/ /alertmanager-notifier
1247
COPY templates/ /templates

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
A notifier for [alertmanager](https://github.com/prometheus/alertmanager), written in python. It supports multiple notification channels and new ones can be easily added.
99

10-
## Running a simple test:
10+
## Running a simple test
11+
1112
```sh
1213
docker run --rm -it \
1314
-p 8899:8899 \
@@ -21,11 +22,13 @@ docker run --rm -it \
2122
```
2223

2324
Run the test agains the bot:
25+
2426
```sh
2527
curl -X POST -d '{"externalURL": "http://foo.bar/", "receiver": "alertmanager-notifier-webhook", "alerts": [{"status":"Testing alertmanager-notifier", "labels":{}, "annotations":{}, "generatorURL": "http://foo.bar"}]}' -H "Content-Type: application/json" localhost:8899/alert
2628
```
2729

28-
## Configure alertmanager:
30+
## Configure alertmanager
31+
2932
```yml
3033
route:
3134
receiver: 'alertmanager webhook'
@@ -38,7 +41,7 @@ receivers:
3841
- url: http://alertmanager-notifier:8899/alert
3942
```
4043
41-
## Supported environment variables:
44+
## Supported environment variables
4245
4346
| **Variable** | **Default** | **Description** |
4447
|:--------------------|:----------------:|:---------------------------------------------------------------------------------------------------------------------------|
@@ -75,16 +78,13 @@ If you set the *annotation* `priority` to your alert, with a number as value, th
7578
## Tags and Arch
7679

7780
The images are multi-arch, with builds for amd64, arm64, armv7 and armv6.
81+
7882
* `vN.N.N` - for example v0.0.1
7983
* `latest` - always pointing to the latest version
8084
* `dev-master` - the last build on the master branch
8185

82-
### Images:
83-
* Gitlab Registry: `registry.gitlab.com/ix.ai/alertmanager-notifier`
84-
* GitHub Registry: `ghcr.io/ix-ai/alertmanager-notifier`
85-
* Docker Hub: `ixdotai/alertmanager-notifier`
86+
### Images
8687

87-
## Resources:
88-
* GitLab: https://gitlab.com/ix.ai/alertmanager-notifier
89-
* GitHub: https://github.com/ix-ai/alertmanager-notifier
90-
* Docker Hub: https://hub.docker.com/r/ixdotai/alertmanager-notifier
88+
* Gitlab Registry: `registry.gitlab.com/ix.ai/alertmanager-notifier` - [gitlab.com/ix.ai/alertmanager-notifier](https://gitlab.com/ix.ai/alertmanager-notifier)
89+
* GitHub Registry: `ghcr.io/ix-ai/alertmanager-notifier` [github.com/ix-ai/alertmanager-notifier](https://github.com/ix-ai/alertmanager-notifier)
90+
* Docker Hub: `ixdotai/alertmanager-notifier` - [hub.docker.com/r/ixdotai/alertmanager-notifier](https://hub.docker.com/r/ixdotai/alertmanager-notifier)

0 commit comments

Comments
 (0)