cleanup makefile

This commit is contained in:
Robert Kaussow 2022-04-24 22:33:30 +02:00
parent ecfb0daa85
commit abbb3d4f89
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
5 changed files with 10 additions and 31 deletions

View File

@ -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',

View File

@ -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
...

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
/dist/
/release/
/drone-docker*
coverage.out

View File

@ -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)

View File

@ -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: