-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 96b546d
Showing
14 changed files
with
1,147 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,40 @@ | ||
name: Integration | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup go | ||
uses: actions/setup-go@v2.1.3 | ||
with: | ||
go-version: '1.16.x' | ||
- name: Vet | ||
run: make vet | ||
- name: Test | ||
run: make coverage | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup go | ||
uses: actions/setup-go@v2.1.3 | ||
with: | ||
go-version: '1.16.x' | ||
- name: Build | ||
run: make build | ||
|
||
docker: | ||
name: Docker | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Docker | ||
run: make docker |
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,16 @@ | ||
name: Quality | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
golangci: | ||
name: GolangCI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: GolangCI | ||
uses: golangci/golangci-lint-action@v2.5.1 | ||
with: | ||
version: v1.31 |
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,71 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup go | ||
uses: actions/setup-go@v2.1.3 | ||
with: | ||
go-version: '1.16.x' | ||
- name: Create release artifacts | ||
run: make release | ||
env: | ||
GOPATH: ${{ github.workspace }}/go | ||
- name: Create Github Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload release artifacts (Mac OS amd64) | ||
id: upload-release-asset-mac | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: build/prometheus-etherpad-exporter-darwin-amd64 | ||
asset_name: prometheus-etherpad-exporter-darwin-amd64 | ||
asset_content_type: application/octet-stream | ||
- name: Upload release artifacts (FreeBSD amd64) | ||
id: upload-release-asset-freebsd | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: build/prometheus-etherpad-exporter-freebsd-amd64 | ||
asset_name: prometheus-etherpad-exporter-freebsd-amd64 | ||
asset_content_type: application/octet-stream | ||
- name: Upload release artifacts (Linux amd64) | ||
id: upload-release-asset-linux | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: build/prometheus-etherpad-exporter-linux-amd64 | ||
asset_name: prometheus-etherpad-exporter-linux-amd64 | ||
asset_content_type: application/octet-stream | ||
- name: Upload release artifacts (shasums) | ||
id: upload-release-asset-sha512sums | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: build/sha512sums.txt | ||
asset_name: sha512sums.txt | ||
asset_content_type: application/octet-stream |
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 @@ | ||
build |
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 @@ | ||
--- | ||
run: | ||
tests: false |
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,34 @@ | ||
FROM golang:1.16.2-alpine as builder | ||
|
||
WORKDIR /go/src/github.com/systemli/prometheus-etherpad-exporter | ||
|
||
ENV USER=appuser | ||
ENV UID=10001 | ||
|
||
RUN adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home "/nonexistent" \ | ||
--shell "/sbin/nologin" \ | ||
--no-create-home \ | ||
--uid "${UID}" \ | ||
"${USER}" | ||
|
||
ADD . /go/src/github.com/systemli/prometheus-etherpad-exporter | ||
RUN go get -d -v && \ | ||
go mod download && \ | ||
go mod verify && \ | ||
CGO_ENABLED=0 go build -ldflags="-w -s" -o /prometheus-etherpad-exporter | ||
|
||
|
||
FROM scratch | ||
|
||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /etc/group /etc/group | ||
COPY --from=builder /prometheus-etherpad-exporter /prometheus-etherpad-exporter | ||
|
||
USER appuser:appuser | ||
|
||
EXPOSE 9011 | ||
|
||
ENTRYPOINT ["/prometheus-etherpad-exporter"] |
Oops, something went wrong.