From ae5be791e9154cd1ab8c3e367d55975e3d891fc0 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 1 Aug 2019 01:06:56 +0200 Subject: [PATCH 1/4] Update dependencies to latest versions --- go.mod | 14 ++++++++------ go.sum | 29 +++++++++++++++++------------ 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 0043237..3ea6713 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,17 @@ module github.com/drone/drone-template-lib +go 1.12 + require ( + bou.ke/monkey v1.0.1 // indirect github.com/Masterminds/goutils v1.1.0 // indirect github.com/Masterminds/semver v1.4.2 // indirect - github.com/Masterminds/sprig v2.18.0+incompatible + github.com/Masterminds/sprig v2.20.0+incompatible github.com/aymerick/raymond v2.0.2+incompatible - github.com/bouk/monkey v1.0.0 - github.com/google/uuid v1.1.0 // indirect + github.com/google/uuid v1.1.1 // indirect github.com/huandu/xstrings v1.2.0 // indirect github.com/imdario/mergo v0.3.7 // indirect - github.com/pkg/errors v0.8.0 - github.com/tkuchiki/faketime v0.0.0-20170607100027-a4500a4f4643 - golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 // indirect + github.com/pkg/errors v0.8.1 + github.com/tkuchiki/faketime v0.1.1 + golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect ) diff --git a/go.sum b/go.sum index f4a900d..e9b5567 100644 --- a/go.sum +++ b/go.sum @@ -1,22 +1,27 @@ +bou.ke/monkey v1.0.1 h1:zEMLInw9xvNakzUUPjfS4Ds6jYPqCFx3m7bRmG5NH2U= +bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.18.0+incompatible h1:QoGhlbC6pter1jxKnjMFxT8EqsLuDE6FEcNbWEpw+lI= -github.com/Masterminds/sprig v2.18.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Masterminds/sprig v2.20.0+incompatible h1:dJTKKuUkYW3RMFdQFXPU/s6hg10RgctmTjRcbZ98Ap8= +github.com/Masterminds/sprig v2.20.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/aymerick/raymond v2.0.2+incompatible h1:VEp3GpgdAnv9B2GFyTvqgcKvY+mfKMjPOA3SbKLtnU0= github.com/aymerick/raymond v2.0.2+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= -github.com/bouk/monkey v1.0.0 h1:k6z8fLlPhETfn5l9rlWVE7Q6B23DoaqosTdArvNQRdc= -github.com/bouk/monkey v1.0.0/go.mod h1:PG/63f4XEUlVyW1ttIeOJmJhhe1+t9EC/je3eTjvFhE= -github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s= -github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/tkuchiki/faketime v0.0.0-20170607100027-a4500a4f4643 h1:ii/sHfgFMByozryLeiDmn1ClZ/Pena4NgpJ4P7UuX9o= -github.com/tkuchiki/faketime v0.0.0-20170607100027-a4500a4f4643/go.mod h1:RXY/TXAwGGL36IKDjrHFMcjpUrEiyWSEtLhFPw3UWF0= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 h1:ng3VDlRp5/DHpSWl02R4rM9I+8M2rhmsuLwAMmkLQWE= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +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/tkuchiki/faketime v0.1.1 h1:UZjBlktFAi23wo+jWuHuNoHUpLnB0j/5B62bl5nCPls= +github.com/tkuchiki/faketime v0.1.1/go.mod h1:RXY/TXAwGGL36IKDjrHFMcjpUrEiyWSEtLhFPw3UWF0= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From ae411a1b98367d1405280c61aa3dfe9d6451da63 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 1 Aug 2019 01:07:06 +0200 Subject: [PATCH 2/4] Simplify gitignore file --- .gitignore | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.gitignore b/.gitignore index 0711390..2d83068 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof - -vendor/ coverage.out From d5fd5d77c7cae12669d5dded0710bcf1182010ac Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 1 Aug 2019 01:07:15 +0200 Subject: [PATCH 3/4] Use a simple standard drone config --- .drone.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.drone.yml b/.drone.yml index 693703d..ffb86b2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,23 +8,17 @@ platform: steps: - name: vet - pull: always - image: golang:1.11 + image: golang:1.12 commands: - go vet ./... - environment: - GO111MODULE: on volumes: - name: gopath path: /go - name: test - pull: always - image: golang:1.11 + image: golang:1.12 commands: - go test -cover ./... - environment: - GO111MODULE: on volumes: - name: gopath path: /go @@ -36,5 +30,5 @@ volumes: trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** From 6502a46a31e47b61fc82d405f40030f634869d66 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 1 Aug 2019 01:07:41 +0200 Subject: [PATCH 4/4] Exclude useless helper methods --- template/helpers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/template/helpers.go b/template/helpers.go index ce84b48..134c28a 100644 --- a/template/helpers.go +++ b/template/helpers.go @@ -134,13 +134,17 @@ func regexReplace(pattern string, input string, replacement string) string { func invalidHelper(name string) bool { invalids := []string{ + "genPrivateKey", + "derivePassword", "buildCustomCert", - "fail", "genSelfSignedCert", "genSignedCert", "genCA", + "fail", "semver", "semverCompare", + "hello", + "trimall", } for _, invalid := range invalids {