File tree Expand file tree Collapse file tree 5 files changed +71
-2
lines changed
Expand file tree Collapse file tree 5 files changed +71
-2
lines changed Original file line number Diff line number Diff line change 1+ name : " CI: docker build"
2+
3+ on : [pull_request]
4+
5+ jobs :
6+
7+ build :
8+
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - uses : actions/checkout@v2
13+ - name : Build the Docker image
14+ run : docker build . --file Dockerfile --tag webdevops/alertmanager2es:$(date +%s)
Original file line number Diff line number Diff line change 1+ name : " Release: docker"
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 6 * * 1'
6+ push :
7+ branches :
8+ - ' **'
9+ tags :
10+ - ' *.*.*'
11+
12+ jobs :
13+ build :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - uses : actions/checkout@v2
17+ - name : Docker meta
18+ id : docker_meta
19+ uses : crazy-max/ghaction-docker-meta@v1
20+ with :
21+ images : webdevops/alertmanager2es,quay.io/webdevops/alertmanager2es
22+ # tag-sha: true
23+
24+ - name : Set up QEMU
25+ uses : docker/setup-qemu-action@v1
26+
27+ - name : Set up Docker Buildx
28+ uses : docker/setup-buildx-action@v1
29+
30+ - name : Login to DockerHub
31+ uses : docker/login-action@v1
32+ with :
33+ username : ${{ secrets.DOCKERHUB_USERNAME }}
34+ password : ${{ secrets.DOCKERHUB_TOKEN }}
35+
36+ - name : Login to Quay
37+ uses : docker/login-action@v1
38+ with :
39+ registry : quay.io
40+ username : ${{ secrets.QUAY_USERNAME }}
41+ password : ${{ secrets.QUAY_TOKEN }}
42+
43+ - name : Build and push
44+ uses : docker/build-push-action@v2
45+ with :
46+ context : .
47+ file : ./Dockerfile
48+ platforms : linux/amd64,linux/arm64
49+ push : ${{ github.event_name != 'pull_request' }}
50+ tags : ${{ steps.docker_meta.outputs.tags }}
51+ labels : ${{ steps.docker_meta.outputs.labels }}
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ RUN make dependencies
1010
1111# Compile
1212COPY ./ /go/src/github.com/webdevops/alertmanager2es
13+ RUN make test
1314RUN make lint
1415RUN make build
1516RUN ./alertmanager2es --help
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ image: build
2929build-push-development :
3030 docker build -t webdevops/$(NAME ) :development . && docker push webdevops/$(NAME ) :development
3131
32+ test :
33+ go test ./...
34+
3235.PHONY : lint
3336lint : $(GOLANGCI_LINT_BIN )
3437 # megacheck fails to respect build flags, causing compilation failure during linting.
Original file line number Diff line number Diff line change 11# alertmanager2es
22
33[ ![ license] ( https://img.shields.io/github/license/webdevops/alertmanager2es.svg )] ( https://github.com/webdevops/alertmanager2es/blob/master/LICENSE )
4- [ ![ Docker ] ( https://img.shields.io/docker/cloud/automated/ webdevops/alertmanager2es )] ( https://hub.docker.com/r/webdevops/alertmanager2es/ )
5- [ ![ Docker Build Status ] ( https://img.shields.io/docker/cloud/build/ webdevops/alertmanager2es )] ( https://hub.docker.com/r /webdevops/alertmanager2es/ )
4+ [ ![ DockerHub ] ( https://img.shields.io/badge/DockerHub- webdevops%2Falertmanager2es-blue )] ( https://hub.docker.com/r/webdevops/alertmanager2es/ )
5+ [ ![ Quay.io ] ( https://img.shields.io/badge/Quay.io- webdevops%2Falertmanager2es-blue )] ( https://quay.io/repository /webdevops/alertmanager2es )
66
77This is a forked version of [ cloudflare's alertmanager2es] ( https://github.com/cloudflare/alertmanager2es ) with
88new golang layout and uses the official ElasticSearch client. It also supports Authentication.
You can’t perform that action at this time.
0 commit comments