Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
switch to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcz committed May 30, 2021
1 parent d8c8eb6 commit 1238e98
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 18 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: build

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

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build
run: make commit
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: "tagged-release"

on:
push:
tags:
- "v*"

jobs:
tagged-release:
name: "Tagged Release"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Build
run: make commit
- name: Automatic Releases
uses: marvinpinto/[email protected]
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
LICENSE.md
target/openldap_exporter*
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,28 @@ GIT_TAG := $(shell git describe --tags 2>/dev/null)
LDFLAGS := -X github.com/tomcz/openldap_exporter.commit=${GITCOMMIT}
LDFLAGS := ${LDFLAGS} -X github.com/tomcz/openldap_exporter.tag=${GIT_TAG}

.PHONY: precommit
precommit: clean format build

travis: clean
.PHONY: commit
commit: clean
GO111MODULE=on GOFLAGS='-mod=vendor' $(MAKE) build

.PHONY: clean
clean:
rm -rf target

target:
mkdir target

.PHONY: format
format:
@echo "Running goimports ..."
@goimports -w -local github.com/tomcz/openldap_exporter $(shell find . -type f -name '*.go' | grep -v '/vendor/')

compile = GOOS=$1 GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o target/openldap_exporter-$1 ./cmd/openldap_exporter

.PHONY: build
build: target
$(call compile,linux)
$(call compile,darwin)
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Build Status](https://travis-ci.org/tomcz/openldap_exporter.svg?branch=master)](https://travis-ci.org/tomcz/openldap_exporter)

# OpenLDAP Prometheus Exporter

This is a simple service that scrapes metrics from OpenLDAP and exports them via HTTP for Prometheus consumption.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tomcz/openldap_exporter

go 1.13
go 1.16

require (
github.com/hashicorp/go-multierror v1.0.0
Expand Down
5 changes: 5 additions & 0 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ github.com/golang/protobuf/proto
# github.com/hashicorp/errwrap v1.0.0
github.com/hashicorp/errwrap
# github.com/hashicorp/go-multierror v1.0.0
## explicit
github.com/hashicorp/go-multierror
# github.com/matttproud/golang_protobuf_extensions v1.0.1
github.com/matttproud/golang_protobuf_extensions/pbutil
# github.com/prometheus/client_golang v1.2.1
## explicit
github.com/prometheus/client_golang/prometheus
github.com/prometheus/client_golang/prometheus/internal
github.com/prometheus/client_golang/prometheus/promhttp
Expand All @@ -33,13 +35,16 @@ github.com/russross/blackfriday/v2
# github.com/shurcooL/sanitized_anchor_name v1.0.0
github.com/shurcooL/sanitized_anchor_name
# github.com/urfave/cli/v2 v2.2.0
## explicit
github.com/urfave/cli/v2
github.com/urfave/cli/v2/altsrc
# golang.org/x/sys v0.0.0-20191010194322-b09406accb47
golang.org/x/sys/windows
# gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d
## explicit
gopkg.in/asn1-ber.v1
# gopkg.in/ldap.v2 v2.5.1
## explicit
gopkg.in/ldap.v2
# gopkg.in/yaml.v2 v2.2.2
gopkg.in/yaml.v2

0 comments on commit 1238e98

Please sign in to comment.