Skip to content

Commit

Permalink
Merge branch 'release-2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
agentmilindu committed May 26, 2019
2 parents c2e1d7b + 2686efd commit ef16236
Show file tree
Hide file tree
Showing 23 changed files with 830 additions and 149 deletions.
17 changes: 10 additions & 7 deletions .dunner.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
build:
- image: node:10.15.0
command: ["node", "--version"]
- image: node:10.15.0
command: ["npm", "--version"]
commands:
- ["node", "--version"]
- ["npm", "--version"]
- image: alpine
dir: pkg
command: ["pwd"]
- image: alpine
command: ["apk", "update"]
commands:
- ["apk", "update"]
- image: alpine
command: ["printenv"]
commands:
- ["printenv"]
envs:
- PERM=775
- ID=dunner
- DIR=`$HOME`
- name: '@show'
- follow: 'show'
args:
- '/root'
show:
- image: alpine
command: ["ls", "$1"]
commands:
- ["ls", "$1"]
mounts:
- '~/Downloads:/root/down'
- ~/Pictures:/root/pics:wr
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@

# Environment file
.env

# Packages
dist/*
# Coverage files
coverage*

# IDE files
.idea/*
63 changes: 63 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Goreleaser documentation at http://goreleaser.com
project_name: dunner
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- 386
- amd64
- arm
- arm64
archives:
- replacements:
386: i386
amd64: x86_64
checksum:
name_template: '{{ .ProjectName }}_checksums.txt'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- Merge pull request
- Merge branch
- Update readme
snapshot:
name_template: "{{.ProjectName}}_{{.Tag}}"

brew:
github:
owner: leopardslab
name: homebrew-dunner
folder: Formula
homepage: https://github.com/leopardslab/Dunner
description: A Docker based task runner tool
test: |
system "#{bin}/dunner version"
nfpm:
name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
homepage: https://github.com/leopardslab/Dunner
description: A Docker based task runner tool
license: MIT
formats:
- deb
- rpm
dependencies:
- git
recommends:
- rpm
snapcraft:
name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
summary: A Docker based task runner tool
description: |
Dunner is a task runner tool like Grunt but used Docker images like CircleCI do. |
You can define tasks and steps of the tasks in your `.dunner.yaml` file and then run these steps with `Dunner do taskname`
grade: stable
confinement: strict
publish: true
44 changes: 31 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
language: go

go:
- "1.11.x"
- master

- 1.11.x
- master
env:
global:
- DEP_VERSION="0.5.0"

- PATH=/snap/bin:$PATH
services:
- docker

- docker
addons:
apt:
packages:
- rpm
- snapd
before_install:
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep

- openssl aes-256-cbc -K $encrypted_12c8071d2874_key -iv $encrypted_12c8071d2874_iv
-in snap.login.enc -out snap.login -d
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64
-o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep
install:
- dep ensure -v

script: go test -v ./...
- make setup
- sudo snap install snapcraft --classic
script:
- make ci
after_success:
- bash <(curl -s https://codecov.io/bash)
- test -n "$TRAVIS_TAG" && snapcraft login --with snap.login
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
verbose: true
on:
tags: true
condition: "$TRAVIS_OS_NAME = linux"
master: true
57 changes: 50 additions & 7 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@
[prune]
go-tests = true
unused-packages = true

[[constraint]]
name = "gopkg.in/go-playground/validator.v9"
version = "9.28.0"

[[constraint]]
name = "github.com/go-playground/universal-translator"
version = "0.16.0"
48 changes: 38 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all install test build clean
ALL_PACKAGES=$(shell go list ./... | grep -v "vendor")

SHA=$(shell git rev-list HEAD --max-count=1 --abbrev-commit)
TAG?=$(shell git tag -l --contains HEAD)
Expand All @@ -8,23 +8,51 @@ ifeq ($(VERSION),)
VERSION := latest
endif


#Go parameters
GOCMD=go
GOINSTALL=$(GOCMD) install
GOTEST=$(GOCMD) test
DEP=dep
.PHONY : all install vet fmt test lint build

all: build
all: build test fmt lint vet

install:
@$(DEP) ensure
setup: install
@go get -u golang.org/x/lint/golint

test: install
@$(GOTEST) -v ./...
install:
@$(DEP) ensure -v

build: install
build: install
@$(GOINSTALL) -ldflags "-X main.version=$(VERSION)-$(SHA) -s"

clean:
rm -rf *
ci: build fmt lint vet
@go test -v $(ALL_PACKAGES) -race -coverprofile=coverage.txt -covermode=atomic

test: build
@go test -v $(ALL_PACKAGES)

vet:
@go vet $(ALL_PACKAGES)

fmt:
@go fmt $(ALL_PACKAGES)

lint:
@golint -set_exit_status $(ALL_PACKAGES)

precommit: build test fmt lint vet

test-coverage:
@echo "mode: count" > coverage-all.out

$(foreach pkg, $(ALL_PACKAGES),\
go test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
@go tool cover -html=coverage-all.out -o coverage.html

release:
@echo "Make sure you run this on master branch to make a release"
@echo "Adding tag for version: $(VERSION)"
git tag -a $(VERSION) -m "Release version $(VERSION)"
@echo "Run \"git push origin $(VERSION)\" to push tag to remote which makes a dunner release!"
Loading

0 comments on commit ef16236

Please sign in to comment.