Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ version: 2
jobs:
build:
docker:
- image: circleci/golang:1.10
- image: circleci/golang:1.16

working_directory: /go/src/github.com/bitnami/ini-file
steps:
- checkout
- run: make get-build-deps
- run: make dep-ensure
- run: make download
- run: make vet
- run: make lint
- run: make cover
- run: make build
- run: make build/arm64
- run: make build TOOL_PATH=out/ini-file
- run: make build/arm64 TOOL_PATH=out/arm64/ini-file
- store_artifacts:
path: /go/src/github.com/bitnami/ini-file/out/ini-file
destination: ini-file
Expand Down
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@
# docker run --rm -it -v /tmp:/tmp bitnami/ini-file del -k "title" -s "My book" /tmp/my.ini
#

FROM golang:1.10-stretch as build
FROM golang:1.16-stretch as build

RUN apt-get update && apt-get install -y --no-install-recommends \
git make upx \
&& rm -rf /var/lib/apt/lists/*

RUN wget -q -O dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && \
echo '287b08291e14f1fae8ba44374b26a2b12eb941af3497ed0ca649253e21ba2f83 dep' | sha256sum -c - && \
mv dep /usr/bin/ && chmod +x /usr/bin/dep

RUN go get -u \
github.com/golang/lint/golint \
golang.org/x/lint/golint \
golang.org/x/tools/cmd/goimports \
github.com/golang/dep/cmd/dep \
&& rm -rf $GOPATH/src/* && rm -rf $GOPATH/pkg/*


Expand Down
84 changes: 0 additions & 84 deletions Gopkg.lock

This file was deleted.

35 changes: 0 additions & 35 deletions Gopkg.toml

This file was deleted.

20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all build clean dep-ensure get-build-deps vet lint get-deps test cover
.PHONY: all build clean download get-build-deps vet lint get-deps test cover

TOOL_NAME := ini-file

Expand All @@ -9,29 +9,29 @@ include ./vars.mk

all:
@$(MAKE) get-build-deps
$(DEP_ENSURE) -vendor-only
@$(MAKE) download
@$(MAKE) vet
@$(MAKE) lint
@$(MAKE) cover
@$(MAKE) build

build:
@go build -ldflags="-s -w" -o $(TOOL_PATH)
build/%:
@echo "Building GOARCH=$(*F)"
@GOARCH=$(*F) go build -ldflags=$(LDFLAGS) -o $(TOOL_PATH)
@echo "*** Binary created under $(TOOL_PATH) ***"

build/arm64:
@GOARCH=arm64 go build -ldflags="-s -w" -o $(BUILD_DIR)/arm64/$(TOOL_NAME)
build: build/amd64

clean:
@rm -rf $(BUILD_DIR)

dep-ensure:
$(DEP_ENSURE)
download:
$(GO_MOD) download

get-build-deps:
@echo "+ Downloading build dependencies"
@go get golang.org/x/tools/cmd/goimports
@go get github.com/golang/lint/golint
@go get -u github.com/golang/dep/cmd/dep
@go get golang.org/x/lint/golint

vet:
@echo "+ Vet"
Expand Down
16 changes: 16 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module github.com/bitnami/ini-file

go 1.16

require (
github.com/bitnami/gonit v0.2.0
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-ini/ini v1.62.0
github.com/jessevdk/go-flags v1.5.0
github.com/juamedgod/cliassert v0.0.0-20180320011200-425256f2bb0b
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/stretchr/testify v1.2.2
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
)
32 changes: 32 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
github.com/bitnami/gonit v0.2.0 h1:qrza7cn2/YmX47SCIBKShqtupSNX4KSwaQJL698s2WU=
github.com/bitnami/gonit v0.2.0/go.mod h1:rWUClL7qwHeUIIP7SkokjfvE3RonglnANqJtzUpyHyU=
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/go-ini/ini v1.62.0 h1:7VJT/ZXjzqSrvtraFp4ONq80hTcRQth1c9ZnQ3uNQvU=
github.com/go-ini/ini v1.62.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juamedgod/cliassert v0.0.0-20180320011200-425256f2bb0b h1:j2GwaFh0vduPA3PilmBcsdWv0reobJHyIxGJnh9gIAA=
github.com/juamedgod/cliassert v0.0.0-20180320011200-425256f2bb0b/go.mod h1:+N11eVKRhj1RNqjc9l+QMib0/XYixFOywXFH1zoGucg=
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/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
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/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU=
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
8 changes: 6 additions & 2 deletions vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ PATH := $(GOPATH)/bin:$(PATH)

BUILD_DIR := $(abspath ./out)
TOOL_NAME ?= $(shell basename $(CURDIR))
TOOL_PATH := $(BUILD_DIR)/$(TOOL_NAME)
TOOL_PATH ?= $(BUILD_DIR)/$(TOOL_NAME)

BUILD_DATE := $(shell date -u '+%Y-%m-%d %I:%M:%S UTC' 2> /dev/null)
GIT_HASH := $(shell git rev-parse HEAD 2> /dev/null)
LDFLAGS="'main.buildDate=$(BUILD_DATE)' -X main.commit=$(GIT_HASH) -s -w"

DEBUG ?= 0

Expand All @@ -14,7 +18,7 @@ else
GO_TEST := @go test
endif

DEP_ENSURE := @dep ensure
GO_MOD := @go mod
# Do not do goimport of the vendor dir
go_files=$$(find $(1) -type f -name '*.go' -not -path "./vendor/*")
fmtcheck = @if goimports -l $(go_files) | read var; then echo "goimports check failed for $(1):\n `goimports -d $(go_files)`"; exit 1; fi