Skip to content

Commit

Permalink
Merge branch 'master' of ssh://github.com/rossigee/openvpnas-exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
rossigee committed Sep 5, 2022
2 parents 70084ab + 85f0268 commit 0c6869b
Show file tree
Hide file tree
Showing 6 changed files with 481 additions and 21 deletions.
30 changes: 30 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2
updates:

# Maintain dependencies for Golang
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
day: "friday"
commit-message:
prefix: "go"
labels:
- "golang"
- "dependencies"
reviewers:
- "rossigee"

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "friday"
commit-message:
prefix: "gh-actions"
labels:
- "gh-actions"
- "dependencies"
reviewers:
- "rossigee"
64 changes: 64 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
18 changes: 10 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# .github/workflows/release.yaml

on: release
Expand All @@ -8,11 +9,11 @@ jobs:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@master
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: '^1.16.3'
- name: golangci-lint
uses: golangci/golangci-lint-action@v2.5.2
uses: golangci/golangci-lint-action@v3.2.0
with:
version: latest
releases-matrix:
Expand All @@ -33,22 +34,23 @@ jobs:
goos: darwin

steps:
- uses: actions/checkout@master
- name: Checkout code
uses: actions/checkout@master

# - uses: actions/setup-go@v2
# - uses: actions/setup-go@v3
# with:
# go-version: '^1.16.3'

- name: Set APP_VERSION env
run: echo APP_VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev ) >> ${GITHUB_ENV}

- name: Environment Printer
uses: managedkaos/[email protected]
# - name: Environment Printer
# uses: managedkaos/[email protected]

- uses: wangyoucao577/go-release-action@v1.16
- uses: wangyoucao577/go-release-action@v1.30
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "${{ env.CMD_PATH }}"
# project_path: "${{ env.CMD_PATH }}"
build_flags: -v
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.19 as builder
ADD . /build
WORKDIR /build
RUN go vet ./...
RUN go test ./...
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs=false -o build/openvpnas_exporter

FROM alpine:latest as certs
RUN apk --update add ca-certificates

FROM scratch
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /build/build/openvpnas_exporter /bin/openvpnas_exporter
EXPOSE 9176
ENTRYPOINT ["/bin/openvpnas_exporter"]
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/rossigee/openvpnas-exporter
go 1.16

require (
alexejk.io/go-xmlrpc v0.2.0 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
alexejk.io/go-xmlrpc v0.4.0
github.com/prometheus/client_golang v1.13.0
)
Loading

0 comments on commit 0c6869b

Please sign in to comment.