diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md new file mode 100755 index 0000000..b79faa8 --- /dev/null +++ b/.chglog/CHANGELOG.tpl.md @@ -0,0 +1,23 @@ +# Changelog + +{{ range .Versions -}} +## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) + +{{ range .CommitGroups -}} +### {{ .Title }} + +{{ range .Commits -}} +- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ (regexReplaceAll "(.*)/issues/(.*)" (regexReplaceAll "(Co-\\w*-by.*)" .Subject "") "${1}/pull/${2}") | trim }} +{{ end }} +{{- end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} + +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} diff --git a/.chglog/config.yml b/.chglog/config.yml new file mode 100755 index 0000000..a34ec0b --- /dev/null +++ b/.chglog/config.yml @@ -0,0 +1,25 @@ +style: github +template: CHANGELOG.tpl.md +info: + title: CHANGELOG + repository_url: https://github.com/thegeeklab/drone-plugin-lib +options: + commit_groups: + title_maps: + feat: Features + fix: Bug Fixes + perf: Performance Improvements + refactor: Code Refactoring + chore: Others + test: Testing + ci: CI Pipeline + docs: Documentation + header: + pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" + pattern_maps: + - Type + - Scope + - Subject + notes: + keywords: + - BREAKING CHANGE diff --git a/.drone.jsonnet b/.drone.jsonnet new file mode 100644 index 0000000..4c0ab4f --- /dev/null +++ b/.drone.jsonnet @@ -0,0 +1,179 @@ +local PipelineTest(deps=[],) = { + kind: 'pipeline', + name: 'test', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'deps', + image: 'golang:1.18', + commands: [ + 'make deps', + ], + volumes: [ + { + name: 'godeps', + path: '/go', + }, + ], + }, + { + name: 'lint', + image: 'golang:1.18', + commands: [ + 'make lint', + ], + volumes: [ + { + name: 'godeps', + path: '/go', + }, + ], + }, + { + name: 'test', + image: 'golang:1.18', + commands: [ + 'make test', + ], + volumes: [ + { + name: 'godeps', + path: '/go', + }, + ], + }, + ], + volumes: [ + { + name: 'godeps', + temp: {}, + }, + ], + depends_on: deps, + trigger: { + ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'], + }, +}; + +local PipelineRelease(deps=[],) = { + kind: 'pipeline', + image_pull_secrets: ['docker_config'], + name: 'release', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'changelog-generate', + image: 'thegeeklab/git-chglog', + commands: [ + 'git fetch -tq', + 'git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}', + ], + }, + { + name: 'changelog-format', + image: 'thegeeklab/alpine-tools', + commands: [ + 'prettier CHANGELOG.md', + 'prettier -w CHANGELOG.md', + ], + }, + { + name: 'publish', + image: 'plugins/github-release', + settings: { + overwrite: true, + api_key: { + from_secret: 'github_token', + }, + title: '${DRONE_TAG}', + note: 'CHANGELOG.md', + }, + when: { + ref: [ + 'refs/tags/**', + ], + }, + }, + ], + depends_on: deps, + trigger: { + ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'], + }, +}; + +local PipelineDocs(deps=[],) = { + kind: 'pipeline', + name: 'docs', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'markdownlint', + image: 'thegeeklab/markdownlint-cli', + commands: [ + "markdownlint 'README.md' 'CONTRIBUTING.md'", + ], + }, + { + name: 'spellcheck', + image: 'node:lts-alpine', + commands: [ + 'npm install -g spellchecker-cli', + "spellchecker --files 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls --no-suggestions", + ], + environment: { + FORCE_COLOR: true, + NPM_CONFIG_LOGLEVEL: 'error', + }, + }, + ], + depends_on: deps, + trigger: { + ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'], + }, +}; + +local PipelineNotifications(deps=[],) = { + kind: 'pipeline', + name: 'notifications', + platform: { + os: 'linux', + arch: 'amd64', + }, + steps: [ + { + name: 'matrix', + image: 'thegeeklab/drone-matrix', + settings: { + homeserver: { from_secret: 'matrix_homeserver' }, + roomid: { from_secret: 'matrix_roomid' }, + template: 'Status: **{{ build.Status }}**
Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.Link }}){{#if build.Branch}} ({{ build.Branch }}){{/if}} by {{ commit.Author }}
Message: {{ commit.Message.Title }}', + username: { from_secret: 'matrix_username' }, + password: { from_secret: 'matrix_password' }, + }, + when: { + status: ['success', 'failure'], + }, + }, + ], + depends_on: deps, + trigger: { + ref: ['refs/heads/main', 'refs/tags/**'], + status: ['success', 'failure'], + }, +}; + +[ + PipelineTest(), + PipelineRelease(deps=['test'],), + PipelineDocs(deps=['release']), + PipelineNotifications(deps=['docs']), +] diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index f45d8f1..0000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": [ - "config:base" - ] -} diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 0000000..b465a9d --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,55 @@ +repository: + name: drone-plugin-lib + description: Custom template library for Drone CI + topics: drone, drone-plugin + + private: false + has_issues: true + has_wiki: false + has_downloads: true + + default_branch: main + + allow_squash_merge: true + allow_merge_commit: true + allow_rebase_merge: true + +labels: + - name: bug + color: d73a4a + description: Something isn't working + - name: documentation + color: 0075ca + description: Improvements or additions to documentation + - name: duplicate + color: cfd3d7 + description: This issue or pull request already exists + - name: enhancement + color: a2eeef + description: New feature or request + - name: good first issue + color: 7057ff + description: Good for newcomers + - name: help wanted + color: 008672 + description: Extra attention is needed + - name: invalid + color: e4e669 + description: This doesn't seem right + - name: question + color: d876e3 + description: Further information is requested + - name: wontfix + color: ffffff + description: This will not be worked on + +branches: + - name: main + protection: + required_pull_request_reviews: null + required_status_checks: + strict: false + contexts: + - continuous-integration/drone/pr + enforce_admins: null + restrictions: null diff --git a/.gitignore b/.gitignore index e69de29..7a8b35d 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,6 @@ +/dist/ +/release/ +/drone-plugin-lib* + +coverage.out +CHANGELOG.md diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..7bb18ea --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,31 @@ +linters: + enable: + - gosimple + - deadcode + - typecheck + - govet + - errcheck + - staticcheck + - unused + - structcheck + - varcheck + - dupl + - gofmt + - misspell + - gocritic + - bidichk + - ineffassign + - revive + - gofumpt + - depguard + enable-all: false + disable-all: true + fast: false + +run: + timeout: 3m + +linters-settings: + gofumpt: + extra-rules: true + lang-version: "1.18" diff --git a/.mailmap b/.mailmap deleted file mode 100644 index 0ed3600..0000000 --- a/.mailmap +++ /dev/null @@ -1 +0,0 @@ -Don Olmstead Don diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 0000000..b59a114 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,6 @@ +--- +default: True +MD013: False +MD041: False +MD004: + style: dash diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..23a4f05 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +.drone.yml +*.tpl.md +LICENSE diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 5bd971e..0000000 --- a/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -Bo-Yi Wu -Don Olmstead -Thomas Boerger diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c471f59 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing + +## Security + +If you think you have found a **security issue**, please do not mention it in this repository. +Instead, send an email to security@thegeeklab.de with as many details as possible so it can be handled confidential. + +## Bug Reports and Feature Requests + +If you have found a **bug** or have a **feature request** please use the search first in case a similar issue already exists. +If not, please create an issue in this repository + +## Code + +If you would like to fix a bug or implement a feature, please fork the repository and create a Pull Request. + +Before you start any Pull Request, it is recommended that you create an issue to discuss first if you have any +doubts about requirement or implementation. That way you can be sure that the maintainer(s) agree on what to change and how, +and you can hopefully get a quick merge afterwards. + +Pull Requests can only be merged once all status checks are green. + +## Do not force push to your Pull Request branch + +Please do not force push to your Pull Requests branch after you have created your Pull Request, as doing so makes it harder for us to review your work. +Pull Requests will always be squashed by us when we merge your work. Commit as many times as you need in your Pull Request branch. + +## Re-requesting a review + +Please do not ping your reviewer(s) by mentioning them in a new comment. Instead, use the re-request review functionality. +Read more about this in the [GitHub docs, Re-requesting a review](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request#re-requesting-a-review). diff --git a/LICENSE b/LICENSE index 261eeb9..c9faf00 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,4 @@ + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -186,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2022 Robert Kaussow Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b37a6ae --- /dev/null +++ b/Makefile @@ -0,0 +1,96 @@ +# renovate: datasource=github-releases depName=mvdan/gofumpt +GOFUMPT_PACKAGE_VERSION := v0.3.1 +# renovate: datasource=github-releases depName=golangci/golangci-lint +GOLANGCI_LINT_PACKAGE_VERSION := v1.45.2 + +EXECUTABLE := drone-plugin-lib + +DIST := dist +DIST_DIRS := $(DIST) +IMPORT := github.com/thegeeklab/$(EXECUTABLE) + +GO ?= go +CWD ?= $(shell pwd) +PACKAGES ?= $(shell go list ./...) +SOURCES ?= $(shell find . -name "*.go" -type f) + +GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@$(GOFUMPT_PACKAGE_VERSION) +GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_PACKAGE_VERSION) +XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest + +GENERATE ?= +XGO_VERSION := go-1.18.x +XGO_TARGETS ?= linux/amd64,linux/arm-6,linux/arm-7,linux/arm64 + +TAGS ?= netgo + +ifndef VERSION + ifneq ($(DRONE_TAG),) + VERSION ?= $(subst v,,$(DRONE_TAG)) + else + VERSION ?= $(shell git rev-parse --short HEAD) + endif +endif + +ifndef DATE + DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%S%z") +endif + +LDFLAGS += -s -w -X "main.BuildVersion=$(VERSION)" -X "main.BuildDate=$(DATE)" + +.PHONY: all +all: clean build + +.PHONY: clean +clean: + $(GO) clean -i ./... + rm -rf $(DIST_DIRS) + +.PHONY: fmt +fmt: + $(GO) run $(GOFUMPT_PACKAGE) -extra -w $(SOURCES) + +.PHONY: golangci-lint +golangci-lint: + $(GO) run $(GOLANGCI_LINT_PACKAGE) run + +.PHONY: lint +lint: golangci-lint + +.PHONY: generate +generate: + $(GO) generate $(GENERATE) + +.PHONY: test +test: + $(GO) test -v -coverprofile coverage.out $(PACKAGES) + +.PHONY: build +build: $(DIST)/$(EXECUTABLE) + +$(DIST)/$(EXECUTABLE): $(SOURCES) + $(GO) build -v -tags '$(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -o $@ ./cmd/$(EXECUTABLE) + +$(DIST_DIRS): + mkdir -p $(DIST_DIRS) + +.PHONY: xgo +xgo: | $(DIST_DIRS) + $(GO) run $(XGO_PACKAGE) -go $(XGO_VERSION) -v -ldflags '-extldflags "-static" $(LDFLAGS)' -tags '$(TAGS)' -targets '$(XGO_TARGETS)' -out $(EXECUTABLE) --pkg cmd/$(EXECUTABLE) . + cp /build/* $(CWD)/$(DIST) + ls -l $(CWD)/$(DIST) + +.PHONY: checksum +checksum: + cd $(DIST); $(foreach file,$(wildcard $(DIST)/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;) + ls -l $(CWD)/$(DIST) + +.PHONY: release +release: xgo checksum + +.PHONY: deps +deps: + $(GO) mod download + $(GO) install $(GOFUMPT_PACKAGE) + $(GO) install $(GOLANGCI_LINT_PACKAGE) + $(GO) install $(XGO_PACKAGE) diff --git a/README.md b/README.md index 068a086..f1a4db3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,35 @@ # drone-plugin-lib -[![Build Status](http://cloud.drone.io/api/badges/drone-plugins/drone-plugin-lib/status.svg)](http://cloud.drone.io/drone-plugins/drone-plugin-lib) -[![Gitter chat](https://badges.gitter.im/drone/drone.png)](https://gitter.im/drone/drone) -[![Join the discussion at https://discourse.drone.io](https://img.shields.io/badge/discourse-forum-orange.svg)](https://discourse.drone.io) -[![Drone questions at https://stackoverflow.com](https://img.shields.io/badge/drone-stackoverflow-orange.svg)](https://stackoverflow.com/questions/tagged/drone.io) -[![Go Doc](https://godoc.org/github.com/drone-plugins/drone-plugin-lib?status.svg)](http://godoc.org/github.com/drone-plugins/drone-plugin-lib) -[![Go Report](https://goreportcard.com/badge/github.com/drone-plugins/drone-plugin-lib)](https://goreportcard.com/report/github.com/drone-plugins/drone-plugin-lib) +[![Build Status](https://img.shields.io/drone/build/thegeeklab/drone-plugin-lib?logo=drone&server=https%3A%2F%2Fdrone.thegeeklab.de)](https://drone.thegeeklab.de/thegeeklab/drone-plugin-lib) +[![Go Report Card](https://goreportcard.com/badge/github.com/thegeeklab/drone-plugin-lib)](https://goreportcard.com/report/github.com/thegeeklab/drone-plugin-lib) +[![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/drone-plugin-lib)](https://github.com/thegeeklab/drone-plugin-lib/graphs/contributors) +[![Source: GitHub](https://img.shields.io/badge/source-github-blue.svg?logo=github&logoColor=white)](https://github.com/thegeeklab/drone-plugin-lib) +[![License: Apache-2.0](https://img.shields.io/github/license/thegeeklab/drone-plugin-lib)](https://github.com/thegeeklab/drone-plugin-lib/blob/main/LICENSE) -Helpers to reduce the biolerplate code for writing Drone CI plugins. +Helper library to reduce the biolerplate code for writing Drone CI plugins. + +## Usage + +### Download the package + +```Shell +go get -d github.com/drone-plugins/drone-plugin-lib/errors +go get -d github.com/drone-plugins/drone-plugin-lib/urfave +go get -d github.com/drone-plugins/drone-plugin-lib/drone +``` + +### Import the package + +```Go +import "github.com/drone-plugins/drone-plugin-lib/errors" +import "github.com/drone-plugins/drone-plugin-lib/urfave" +import "github.com/drone-plugins/drone-plugin-lib/drone" +``` + +## Contributors + +Special thanks goes to all [contributors](https://github.com/thegeeklab/drone-plugin-lib/graphs/contributors). If you would like to contribute, please see the [instructions](https://github.com/thegeeklab/drone-plugin-lib/blob/main/CONTRIBUTING.md). + +## License + +This project is licensed under the Apache-2.0 License - see the [LICENSE](https://github.com/thegeeklab/drone-plugin-lib/blob/main/LICENSE) file for details. diff --git a/drone/build.go b/drone/build.go index ec0cd0d..2aa14f7 100644 --- a/drone/build.go +++ b/drone/build.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/drone/calver.go b/drone/calver.go index 208a535..9ec6a5f 100644 --- a/drone/calver.go +++ b/drone/calver.go @@ -1,7 +1,4 @@ // Copyright (c) 2020, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. -// Use of this source code is governed by an Apache 2.0 license that can be -// found in the LICENSE file. package drone diff --git a/drone/commit.go b/drone/commit.go index 3db1f09..189fe7d 100644 --- a/drone/commit.go +++ b/drone/commit.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/drone/network.go b/drone/network.go index a60c89e..fb560a3 100644 --- a/drone/network.go +++ b/drone/network.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/drone/pipeline.go b/drone/pipeline.go index 17f1fa1..67d0555 100644 --- a/drone/pipeline.go +++ b/drone/pipeline.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/drone/plugin.go b/drone/plugin.go index 1147e65..c0fc773 100644 --- a/drone/plugin.go +++ b/drone/plugin.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/drone/repo.go b/drone/repo.go index 80aadc1..bc25f71 100644 --- a/drone/repo.go +++ b/drone/repo.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/drone/semver.go b/drone/semver.go index 803b89c..054431c 100644 --- a/drone/semver.go +++ b/drone/semver.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/drone/stage.go b/drone/stage.go index 38769cf..f4c7849 100644 --- a/drone/stage.go +++ b/drone/stage.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/drone/step.go b/drone/step.go index 1f6ed9d..92b03f1 100644 --- a/drone/step.go +++ b/drone/step.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/drone/system.go b/drone/system.go index 885e244..3d136e5 100644 --- a/drone/system.go +++ b/drone/system.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/go.mod b/go.mod index 6fd216e..4e33799 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,14 @@ -module github.com/drone-plugins/drone-plugin-lib +module github.com/thegeeklab/drone-plugin-lib -go 1.15 +go 1.18 require ( - github.com/sirupsen/logrus v1.7.0 - github.com/urfave/cli/v2 v2.3.0 - gotest.tools/v3 v3.0.3 + github.com/sirupsen/logrus v1.8.1 + github.com/urfave/cli/v2 v2.5.1 +) + +require ( + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect ) diff --git a/go.sum b/go.sum index 75fab4e..fe980ed 100644 --- a/go.sum +++ b/go.sum @@ -1,42 +1,17 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= -github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= -github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= +github.com/urfave/cli/v2 v2.5.1 h1:YKwdkyA0xTBzOaP2G0DVxBnCheHGP+Y9VbKAs4K1Ess= +github.com/urfave/cli/v2 v2.5.1/go.mod h1:oDzoM7pVwz6wHn5ogWgFUU1s4VJayeQS+aEZDqXIEJs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..45d1c03 --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["github>thegeeklab/renovate-presets:golang"] +} diff --git a/trace/http.go b/trace/http.go index ee3cbe5..6d2b682 100644 --- a/trace/http.go +++ b/trace/http.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. diff --git a/urfave/build.go b/urfave/build.go index a0942f7..d272a84 100644 --- a/urfave/build.go +++ b/urfave/build.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. @@ -8,7 +9,7 @@ package urfave import ( "time" - "github.com/drone-plugins/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/drone" "github.com/urfave/cli/v2" ) diff --git a/urfave/calver.go b/urfave/calver.go index 69e9709..878953e 100644 --- a/urfave/calver.go +++ b/urfave/calver.go @@ -1,12 +1,9 @@ // Copyright (c) 2020, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. -// Use of this source code is governed by an Apache 2.0 license that can be -// found in the LICENSE file. package urfave import ( - "github.com/drone-plugins/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/drone" "github.com/urfave/cli/v2" ) diff --git a/urfave/commit.go b/urfave/commit.go index 8aff7cc..573da7b 100644 --- a/urfave/commit.go +++ b/urfave/commit.go @@ -1,12 +1,13 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. package urfave import ( - "github.com/drone-plugins/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/drone" "github.com/urfave/cli/v2" ) diff --git a/urfave/doc.go b/urfave/doc.go index 3fbb641..489b0f0 100644 --- a/urfave/doc.go +++ b/urfave/doc.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. @@ -11,7 +12,7 @@ // read these environment variables and extract them into structs. // // import ( -// "github.com/drone-plugins/drone-plugin-lib/urfave" +// "github.com/thegeeklab/drone-plugin-lib/urfave" // "github.com/urfave/cli/v2" // ) // diff --git a/urfave/logging.go b/urfave/logging.go index cf1a96c..4f55a01 100644 --- a/urfave/logging.go +++ b/urfave/logging.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. @@ -24,7 +25,6 @@ func loggingFlags() []cli.Flag { // LoggingFromContext sets the logrus logging level. func LoggingFromContext(ctx *cli.Context) { lvl, err := logrus.ParseLevel(ctx.String("log-level")) - if err != nil { lvl = logrus.InfoLevel } diff --git a/urfave/network.go b/urfave/network.go index a155366..3736b7c 100644 --- a/urfave/network.go +++ b/urfave/network.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. @@ -12,9 +13,9 @@ import ( "net/http" "time" - "github.com/drone-plugins/drone-plugin-lib/drone" - "github.com/drone-plugins/drone-plugin-lib/trace" "github.com/sirupsen/logrus" + "github.com/thegeeklab/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/trace" "github.com/urfave/cli/v2" ) diff --git a/urfave/repo.go b/urfave/repo.go index 09a2a70..836fcfd 100644 --- a/urfave/repo.go +++ b/urfave/repo.go @@ -1,12 +1,13 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. package urfave import ( - "github.com/drone-plugins/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/drone" "github.com/urfave/cli/v2" ) diff --git a/urfave/semver.go b/urfave/semver.go index 21a1632..c5d7b55 100644 --- a/urfave/semver.go +++ b/urfave/semver.go @@ -1,12 +1,13 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. package urfave import ( - "github.com/drone-plugins/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/drone" "github.com/urfave/cli/v2" ) diff --git a/urfave/stage.go b/urfave/stage.go index 4d8b387..cc58634 100644 --- a/urfave/stage.go +++ b/urfave/stage.go @@ -1,5 +1,6 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. @@ -8,7 +9,7 @@ package urfave import ( "time" - "github.com/drone-plugins/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/drone" "github.com/urfave/cli/v2" ) diff --git a/urfave/step.go b/urfave/step.go index c31642e..acb2844 100644 --- a/urfave/step.go +++ b/urfave/step.go @@ -1,12 +1,13 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. package urfave import ( - "github.com/drone-plugins/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/drone" "github.com/urfave/cli/v2" ) diff --git a/urfave/system.go b/urfave/system.go index 6777531..9c9e77c 100644 --- a/urfave/system.go +++ b/urfave/system.go @@ -1,12 +1,13 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. package urfave import ( - "github.com/drone-plugins/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/drone" "github.com/urfave/cli/v2" ) diff --git a/urfave/urfave.go b/urfave/urfave.go index 370d087..d732be3 100644 --- a/urfave/urfave.go +++ b/urfave/urfave.go @@ -1,12 +1,13 @@ -// Copyright (c) 2019, the Drone Plugins project authors. -// Please see the AUTHORS file for details. All rights reserved. +// Copyright (c) 2019, Drone Plugins project authors +// Copyright (c) 2021, Robert Kaussow + // Use of this source code is governed by an Apache 2.0 license that can be // found in the LICENSE file. package urfave import ( - "github.com/drone-plugins/drone-plugin-lib/drone" + "github.com/thegeeklab/drone-plugin-lib/drone" "github.com/urfave/cli/v2" )