Skip to content

Commit

Permalink
Align files (#69)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
architectbot and actions-user authored Dec 15, 2020
1 parent ce84a03 commit 7537058
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 179 deletions.
60 changes: 31 additions & 29 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
# DO NOT EDIT. Generated with:
#
# devctl gen dependabot
# devctl@4.0.1
#
version: 2
updates:
- package-ecosystem: docker
directory: "/"
schedule:
interval: weekly
time: "04:00"
target-branch: master
reviewers:
- giantswarm/team-batman-engineers
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
time: "04:00"
target-branch: master
reviewers:
- giantswarm/team-batman-engineers
- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
time: "04:00"
open-pull-requests-limit: 10
reviewers:
- giantswarm/team-batman-engineers
ignore:
- dependency-name: k8s.io/*
versions:
- ">=0.19.0"
- package-ecosystem: docker
directory: "/"
schedule:
interval: weekly
time: "04:00"
open-pull-requests-limit: 10
reviewers:
- giantswarm/team-batman-engineers
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
time: "04:00"
open-pull-requests-limit: 10
reviewers:
- giantswarm/team-batman-engineers
ignore:
- dependency-name: zricethezav/gitleaks-action
- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
time: "04:00"
open-pull-requests-limit: 10
reviewers:
- giantswarm/team-batman-engineers
ignore:
- dependency-name: k8s.io/*
versions:
- ">=0.19.0"
10 changes: 8 additions & 2 deletions .github/workflows/zz_generated.create_release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl gen workflows
# devctl@4.0.1
#
name: Create Release
on:
Expand Down Expand Up @@ -196,8 +196,14 @@ jobs:
- name: Create long-lived release branch
run: |
current_version="${{ needs.gather_facts.outputs.version }}"
parent_version="$(git describe --tags --abbrev=0 HEAD^)"
parent_version="$(git describe --tags --abbrev=0 HEAD^ || true)"
parent_version="${parent_version#v}" # Strip "v" prefix.
if [[ -z "$parent_version" ]] ; then
echo "Unable to find a parent tag version. No branch to create."
exit 0
fi
echo "current_version=$current_version parent_version=$parent_version"
current_major=$(semver get major $current_version)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zz_generated.create_release_pr.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl gen workflows
# devctl@4.0.1
#
name: Create Release PR
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zz_generated.gitleaks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated with:
#
# devctl gen workflows
# devctl@4.0.1
#
name: gitleaks

Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/zz_generated.gomodtidy.yaml

This file was deleted.

105 changes: 3 additions & 102 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,111 +1,12 @@
# DO NOT EDIT. Generated with:
#
# devctl gen makefile
# devctl@4.0.1
#

PACKAGE_DIR := ./bin-dist

APPLICATION := $(shell go list . | cut -d '/' -f 3)
BUILDTIMESTAMP := $(shell date -u '+%FT%TZ')
GITSHA1 := $(shell git rev-parse --verify HEAD)
OS := $(shell go env GOOS)
SOURCES := $(shell find . -name '*.go')
VERSION := $(shell architect project version)
LDFLAGS ?= -w -linkmode 'auto' -extldflags '-static' \
-X '$(shell go list .)/pkg/project.buildTimestamp=${BUILDTIMESTAMP}' \
-X '$(shell go list .)/pkg/project.gitSHA=${GITSHA1}'
.DEFAULT_GOAL := build

.PHONY: build build-darwin build-linux
## build: builds a local binary
build: $(APPLICATION)
@echo "====> $@"
## build-darwin: builds a local binary for darwin/amd64
build-darwin: $(APPLICATION)-darwin
@echo "====> $@"
## build-linux: builds a local binary for linux/amd64
build-linux: $(APPLICATION)-linux
@echo "====> $@"

$(APPLICATION): $(APPLICATION)-v$(VERSION)-$(OS)-amd64
@echo "====> $@"
cp -a $< $@

$(APPLICATION)-darwin: $(APPLICATION)-v$(VERSION)-darwin-amd64
@echo "====> $@"
cp -a $< $@

$(APPLICATION)-linux: $(APPLICATION)-v$(VERSION)-linux-amd64
@echo "====> $@"
cp -a $< $@

$(APPLICATION)-v$(VERSION)-%-amd64: $(SOURCES)
@echo "====> $@"
CGO_ENABLED=0 GOOS=$* GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o $@ .

.PHONY: package-darwin package-linux
## package-darwin: prepares a packaged darwin/amd64 version
package-darwin: $(PACKAGE_DIR)/$(APPLICATION)-v$(VERSION)-darwin-amd64.tar.gz
@echo "====> $@"
## package-linux: prepares a packaged linux/amd64 version
package-linux: $(PACKAGE_DIR)/$(APPLICATION)-v$(VERSION)-linux-amd64.tar.gz
@echo "====> $@"

$(PACKAGE_DIR)/$(APPLICATION)-v$(VERSION)-%-amd64.tar.gz: DIR=$(PACKAGE_DIR)/$<
$(PACKAGE_DIR)/$(APPLICATION)-v$(VERSION)-%-amd64.tar.gz: $(APPLICATION)-v$(VERSION)-%-amd64
@echo "====> $@"
mkdir -p $(DIR)
cp $< $(DIR)/$(APPLICATION)
cp README.md LICENSE $(DIR)
tar -C $(PACKAGE_DIR) -cvzf $(PACKAGE_DIR)/$<.tar.gz $<
rm -rf $(DIR)
rm -rf $<

.PHONY: install
## install: install the application
install:
@echo "====> $@"
go install -ldflags "$(LDFLAGS)" .

.PHONY: run
## run: runs go run main.go
run:
@echo "====> $@"
go run -ldflags "$(LDFLAGS)" -race .

.PHONY: clean
## clean: cleans the binary
clean:
@echo "====> $@"
rm -f $(APPLICATION)*
go clean

.PHONY: imports
## imports: runs goimports
imports:
@echo "====> $@"
goimports -local $(shell go list .) -w .

.PHONY: lint
## lint: runs golangci-lint
lint:
@echo "====> $@"
golangci-lint run -E gosec -E goconst --timeout=15m ./...

.PHONY: test
## test: runs go test with default values
test:
@echo "====> $@"
go test -ldflags "$(LDFLAGS)" -race ./...

.PHONY: build-docker
## build-docker: builds docker image to registry
build-docker: build-linux
@echo "====> $@"
docker build -t ${APPLICATION}:${VERSION} .
include Makefile.*.mk

.PHONY: help
## help: prints this help message
help:
@echo "Usage: \n"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /' | sort
105 changes: 105 additions & 0 deletions Makefile.gen.go.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# DO NOT EDIT. Generated with:
#
# [email protected]
#

PACKAGE_DIR := ./bin-dist

APPLICATION := $(shell go list . | cut -d '/' -f 3)
BUILDTIMESTAMP := $(shell date -u '+%FT%TZ')
GITSHA1 := $(shell git rev-parse --verify HEAD)
OS := $(shell go env GOOS)
SOURCES := $(shell find . -name '*.go')
VERSION := $(shell architect project version)
LDFLAGS ?= -w -linkmode 'auto' -extldflags '-static' \
-X '$(shell go list .)/pkg/project.buildTimestamp=${BUILDTIMESTAMP}' \
-X '$(shell go list .)/pkg/project.gitSHA=${GITSHA1}'
.DEFAULT_GOAL := build

.PHONY: build build-darwin build-linux
## build: builds a local binary
build: $(APPLICATION)
@echo "====> $@"
## build-darwin: builds a local binary for darwin/amd64
build-darwin: $(APPLICATION)-darwin
@echo "====> $@"
## build-linux: builds a local binary for linux/amd64
build-linux: $(APPLICATION)-linux
@echo "====> $@"

$(APPLICATION): $(APPLICATION)-v$(VERSION)-$(OS)-amd64
@echo "====> $@"
cp -a $< $@

$(APPLICATION)-darwin: $(APPLICATION)-v$(VERSION)-darwin-amd64
@echo "====> $@"
cp -a $< $@

$(APPLICATION)-linux: $(APPLICATION)-v$(VERSION)-linux-amd64
@echo "====> $@"
cp -a $< $@

$(APPLICATION)-v$(VERSION)-%-amd64: $(SOURCES)
@echo "====> $@"
CGO_ENABLED=0 GOOS=$* GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o $@ .

.PHONY: package-darwin package-linux
## package-darwin: prepares a packaged darwin/amd64 version
package-darwin: $(PACKAGE_DIR)/$(APPLICATION)-v$(VERSION)-darwin-amd64.tar.gz
@echo "====> $@"
## package-linux: prepares a packaged linux/amd64 version
package-linux: $(PACKAGE_DIR)/$(APPLICATION)-v$(VERSION)-linux-amd64.tar.gz
@echo "====> $@"

$(PACKAGE_DIR)/$(APPLICATION)-v$(VERSION)-%-amd64.tar.gz: DIR=$(PACKAGE_DIR)/$<
$(PACKAGE_DIR)/$(APPLICATION)-v$(VERSION)-%-amd64.tar.gz: $(APPLICATION)-v$(VERSION)-%-amd64
@echo "====> $@"
mkdir -p $(DIR)
cp $< $(DIR)/$(APPLICATION)
cp README.md LICENSE $(DIR)
tar -C $(PACKAGE_DIR) -cvzf $(PACKAGE_DIR)/$<.tar.gz $<
rm -rf $(DIR)
rm -rf $<

.PHONY: install
## install: install the application
install:
@echo "====> $@"
go install -ldflags "$(LDFLAGS)" .

.PHONY: run
## run: runs go run main.go
run:
@echo "====> $@"
go run -ldflags "$(LDFLAGS)" -race .

.PHONY: clean
## clean: cleans the binary
clean:
@echo "====> $@"
rm -f $(APPLICATION)*
go clean

.PHONY: imports
## imports: runs goimports
imports:
@echo "====> $@"
goimports -local $(shell go list .) -w .

.PHONY: lint
## lint: runs golangci-lint
lint:
@echo "====> $@"
golangci-lint run -E gosec -E goconst --timeout=15m ./...

.PHONY: test
## test: runs go test with default values
test:
@echo "====> $@"
go test -ldflags "$(LDFLAGS)" -race ./...

.PHONY: build-docker
## build-docker: builds docker image to registry
build-docker: build-linux
@echo "====> $@"
docker build -t ${APPLICATION}:${VERSION} .

0 comments on commit 7537058

Please sign in to comment.