Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #51 from errm/go-modules
Browse files Browse the repository at this point in the history
Migrate to go modules
  • Loading branch information
errm committed Feb 26, 2019
2 parents 173d694 + c51605a commit 5350109
Show file tree
Hide file tree
Showing 238 changed files with 659 additions and 111,004 deletions.
13 changes: 13 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
linters-settings:
lll:
line-length: 141

linters:
enable-all: true
disable:
- prealloc
- gochecknoglobals
- dupl

service:
golangci-lint-version: 1.15.x # use the fixed version to not introduce new linters unexpectedly
4 changes: 0 additions & 4 deletions .gometalinter.json

This file was deleted.

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
language: go

go:
- "1.10.x"
- "1.11.x"

services:
- docker

before_script: bash .travis/setup.sh

script: make
script: make test ekstrap

after_success:
- bash <(curl -s https://codecov.io/bash)
Expand Down
4 changes: 2 additions & 2 deletions .travis/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -euo pipefail

GORELEASER_VERSION="0.79.0"
GORELEASER_CHECKSUM="8b3f62f582bddde2a29b1d33baaf92b66281312c2fd8a3d38ad2bac8e35c14dd"
GORELEASER_VERSION="0.98.0"
GORELEASER_CHECKSUM="85c3e4027e5aed1b5af6d75ed7fb1cb595a963335653ef3e6b8df3497e351755"

export DEBIAN_FRONTEND=noninteractive

Expand Down
2 changes: 0 additions & 2 deletions .travis/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ set -euo pipefail

openssl aes-256-cbc -K $encrypted_189aefeda93d_key -iv $encrypted_189aefeda93d_iv -in .travis/ekstrap.asc.enc -out .travis/ekstrap.asc -d
gpg --import .travis/ekstrap.asc
make install-linter
go get -u github.com/gobuffalo/packr/...
91 changes: 0 additions & 91 deletions Gopkg.lock

This file was deleted.

30 changes: 0 additions & 30 deletions Gopkg.toml

This file was deleted.

26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
export GO111MODULE=on

GOCMD=go
GOBUILD=$(GOCMD) build -ldflags="-s -w"
GOTEST=$(GOCMD) test
UPX=upx -9
BINARY_NAME=ekstrap
WORKDIR=/go/src/github.com/errm/ekstrap
PWD=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

GOMETALINTER = gometalinter ./...
GORELEASER = goreleaser release --rm-dist --debug

all: test lint $(BINARY_NAME)
$(BINARY_NAME): generate
$(BINARY_NAME): deps generate
$(GOBUILD) -o $(BINARY_NAME) -v
compress: $(BINARY_NAME)
strip -x $(BINARY_NAME)
$(UPX) $(BINARY_NAME)
test: generate
test: deps generate
$(GOTEST) -coverprofile=coverage.txt -covermode=count ./...
install-linter:
$(GOCMD) get -u github.com/alecthomas/gometalinter
$(GOMETALINTER) --install
lint:
$(GOMETALINTER)
command -v golangci-lint || GO111MODULE=off $(GOCMD) get -u github.com/golangci/golangci-lint/cmd/golangci-lint
golangci-lint run
release: generate .goreleaser.yml
$(GORELEASER)
snapshot: .goreleaser.yml
$(GORELEASER) --snapshot
install: $(BINARY_NAME)
install -m755 $(BINARY_NAME) /usr/sbin
generate:
command -v packr2 || $(GOCMD) get github.com/gobuffalo/packr/v2/packr2@v2.0.2
$(GOCMD) generate
clean:
rm -rf \
./$(BINARY_NAME) \
./dist/
$(GOCMD) clean
packr2 clean
rm -rf ./dist/
deps:
$(GOCMD) build -v ./...
upgrade:
$(GOCMD) get -u
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,14 @@ Will run the tests and build a binary

### Linting

We run [some](.gometalinter.json) linting processes.
We run some linting processes on [GolangCI](https://golangci.com)

To run locally:

* First install gometalinter: `make install-linter`.
* Then run: `make lint`
To run locally: `make lint`

## Dependencies

To build ekstrap you need [go](https://golang.org/)

Dependencies are checked into the vendor folder so you can build the project without any extra tools,
but if you need to change or update them you will need to install [dep](https://golang.github.io/dep/).

If you want a tiny binary, install [upx](https://upx.github.io/) and run the `make compress` task.

ekstrap currently only works with systemd, if you want us to support another init system please comment here https://github.com/errm/ekstrap/issues/28.
Expand Down
13 changes: 13 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module github.com/errm/ekstrap

require (
github.com/aws/aws-sdk-go v1.14.3
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d
github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185
github.com/go-ini/ini v1.37.0
github.com/gobuffalo/packr/v2 v2.0.2
github.com/godbus/dbus v4.1.0+incompatible
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8
github.com/pkg/errors v0.8.1
golang.org/x/sys v0.0.0-20190116161447-11f53e031339 // indirect
)
Loading

0 comments on commit 5350109

Please sign in to comment.