From abbb3d4f895d581daf3b36924add4682e27412d8 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 24 Apr 2022 22:33:30 +0200 Subject: [PATCH] cleanup makefile --- .drone.jsonnet | 6 +----- .drone.yml | 22 ++-------------------- .gitignore | 1 + Makefile | 10 +++++----- _docs/_index.md | 2 +- 5 files changed, 10 insertions(+), 31 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 83bc58b..064871a 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,6 +1,5 @@ local PipelineTest = { kind: 'pipeline', - image_pull_secrets: ['docker_config'], name: 'test', platform: { os: 'linux', @@ -61,7 +60,6 @@ local PipelineTest = { local PipelineBuildBinaries = { kind: 'pipeline', - image_pull_secrets: ['docker_config'], name: 'build-binaries', platform: { os: 'linux', @@ -79,7 +77,7 @@ local PipelineBuildBinaries = { name: 'executable', image: 'alpine', commands: [ - '$(find dist/ -executable -type f | grep drone-docker-linux-amd64) --help', + '$(find dist/ -executable -type f -iname ${DRONE_REPO_NAME}-linux-amd64) --help', ], }, { @@ -127,7 +125,6 @@ local PipelineBuildBinaries = { local PipelineBuildContainer(arch='amd64') = { kind: 'pipeline', - image_pull_secrets: ['docker_config'], name: 'build-container-' + arch, platform: { os: 'linux', @@ -258,7 +255,6 @@ local PipelineDocs = { local PipelineNotifications = { kind: 'pipeline', - image_pull_secrets: ['docker_config'], name: 'notifications', platform: { os: 'linux', diff --git a/.drone.yml b/.drone.yml index 4b0c564..fcbc6fa 100644 --- a/.drone.yml +++ b/.drone.yml @@ -35,9 +35,6 @@ volumes: - name: godeps temp: {} -image_pull_secrets: - - docker_config - trigger: ref: - refs/heads/main @@ -61,7 +58,7 @@ steps: - name: executable image: alpine commands: - - $(find dist/ -executable -type f | grep drone-docker-linux-amd64) --help + - $(find dist/ -executable -type f -iname ${DRONE_REPO_NAME}-linux-amd64) --help - name: changelog-generate image: thegeeklab/git-chglog @@ -89,9 +86,6 @@ steps: ref: - refs/tags/** -image_pull_secrets: - - docker_config - trigger: ref: - refs/heads/main @@ -174,9 +168,6 @@ steps: depends_on: - dryrun -image_pull_secrets: - - docker_config - trigger: ref: - refs/heads/main @@ -259,9 +250,6 @@ steps: depends_on: - dryrun -image_pull_secrets: - - docker_config - trigger: ref: - refs/heads/main @@ -344,9 +332,6 @@ steps: depends_on: - dryrun -image_pull_secrets: - - docker_config - trigger: ref: - refs/heads/main @@ -486,9 +471,6 @@ steps: - success - failure -image_pull_secrets: - - docker_config - trigger: ref: - refs/heads/main @@ -502,6 +484,6 @@ depends_on: --- kind: signature -hmac: 9ee9ec07028e26d74e30bb239266b01dd105621178225d50bf2a214712d816e9 +hmac: 04cbe3e2b04cabcdb331f8dbba48337bb365ed4b6fd2f122eed3f4a7c81160d2 ... diff --git a/.gitignore b/.gitignore index 5776c75..4b1466d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /dist/ +/release/ /drone-docker* coverage.out diff --git a/Makefile b/Makefile index 300a8ca..d1bdb88 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ all: clean build .PHONY: clean clean: - go clean -i ./... + $(GO) clean -i ./... rm -rf $(DIST_DIRS) .PHONY: fmt @@ -59,24 +59,24 @@ lint: golangci-lint .PHONY: generate generate: - go generate $(GENERATE) + $(GO) generate $(GENERATE) .PHONY: test test: - go test -v -coverprofile coverage.out $(PACKAGES) + $(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) + $(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) . + $(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) diff --git a/_docs/_index.md b/_docs/_index.md index 4969ae2..5baa242 100644 --- a/_docs/_index.md +++ b/_docs/_index.md @@ -31,7 +31,7 @@ export GOARCH=amd64 export CGO_ENABLED=0 export GO111MODULE=on -go build -v -a -tags netgo -o release/amd64/drone-docker ./cmd/drone-docker/ +go build -v -a -tags netgo -o dist/drone-docker ./cmd/drone-docker/ ``` Build the Docker image with the following command: