Skip to content

Commit

Permalink
Merge pull request #136 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 1.6.2
  • Loading branch information
andyone authored Jun 17, 2024
2 parents 59a248a + 75d862f commit cf4ca07
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 54 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ updates:
- "andyone"
reviewers:
- "andyone"
groups:
all:
applies-to: version-updates
update-types:
- "minor"
- "patch"

- package-ecosystem: "github-actions"
directory: "/"
Expand Down
4 changes: 4 additions & 0 deletions .github/images/card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/images/license.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions .github/images/usage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 39 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
################################################################################

# This Makefile generated by GoMakeGen 2.2.0 using next command:
# This Makefile generated by GoMakeGen 3.0.2 using next command:
# gomakegen --mod .
#
# More info: https://kaos.sh/gomakegen

################################################################################

export GO111MODULE=on

ifdef VERBOSE ## Print verbose information (Flag)
VERBOSE_FLAG = -v
endif

COMPAT ?= 1.19
MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD)

################################################################################

.DEFAULT_GOAL := help
.PHONY = fmt vet all clean deps update init vendor mod-init mod-update mod-download mod-vendor help
.PHONY = fmt vet all install uninstall clean deps update init vendor mod-init mod-update mod-download mod-vendor help

################################################################################

all: deadline ## Build all binaries

deadline:
go build $(VERBOSE_FLAG) -ldflags="-X main.gitrev=$(GITREV)" deadline.go
@echo "Building deadline…"
@go build $(VERBOSE_FLAG) -ldflags="-X main.gitrev=$(GITREV)" deadline.go

install: ## Install all binaries
cp deadline /usr/bin/deadline
@echo "Installing binaries…"
@cp deadline /usr/bin/deadline

uninstall: ## Uninstall all binaries
rm -f /usr/bin/deadline
@echo "Removing installed binaries…"
@rm -f /usr/bin/deadline

init: mod-init ## Initialize new module

Expand All @@ -43,57 +45,70 @@ update: mod-update ## Update dependencies to the latest versions
vendor: mod-vendor ## Make vendored copy of dependencies

mod-init:
@echo "[1/2] Modules initialization…"
ifdef MODULE_PATH ## Module path for initialization (String)
go mod init $(MODULE_PATH)
@go mod init $(MODULE_PATH)
else
go mod init
@go mod init
endif

@echo "[2/2] Dependencies cleanup…"
ifdef COMPAT ## Compatible Go version (String)
go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
@go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) -go=$(COMPAT)
else
go mod tidy $(VERBOSE_FLAG)
@go mod tidy $(VERBOSE_FLAG)
endif

mod-update:
@echo "[1/4] Updating dependencies…"
ifdef UPDATE_ALL ## Update all dependencies (Flag)
go get -u $(VERBOSE_FLAG) all
@go get -u $(VERBOSE_FLAG) all
else
go get -u $(VERBOSE_FLAG) ./...
@go get -u $(VERBOSE_FLAG) ./...
endif

@echo "[2/4] Stripping toolchain info…"
@grep -q 'toolchain ' go.mod && go mod edit -toolchain=none || :

@echo "[3/4] Dependencies cleanup…"
ifdef COMPAT
go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
@go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
else
go mod tidy $(VERBOSE_FLAG)
@go mod tidy $(VERBOSE_FLAG)
endif

test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :
@echo "[4/4] Updating vendored dependencies…"
@test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :

mod-download:
go mod download
@echo "Downloading dependencies…"
@go mod download

mod-vendor:
rm -rf vendor && go mod vendor $(VERBOSE_FLAG)
@echo "Vendoring dependencies…"
@rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :

fmt: ## Format source code with gofmt
find . -name "*.go" -exec gofmt -s -w {} \;
@echo "Formatting sources…"
@find . -name "*.go" -exec gofmt -s -w {} \;

vet: ## Runs 'go vet' over sources
go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...
@echo "Running 'go vet' over sources…"
@go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...

clean: ## Remove generated files
rm -f deadline
@echo "Removing built binaries…"
@rm -f deadline

help: ## Show this info
@echo -e '\n\033[1mTargets:\033[0m\n'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-14s\033[0m %s\n", $$1, $$2}'
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-9s\033[0m %s\n", $$1, $$2}'
@echo -e '\n\033[1mVariables:\033[0m\n'
@grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \
| sed 's/ifdef //' \
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}'
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-11s\033[0m %s\n", $$1, $$2}'
@echo -e ''
@echo -e '\033[90mGenerated by GoMakeGen 2.2.0\033[0m\n'
@echo -e '\033[90mGenerated by GoMakeGen 3.0.2\033[0m\n'

################################################################################
23 changes: 4 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<p align="center"><a href="#readme"><img src="https://gh.kaos.st/deadline.svg"/></a></p>
<p align="center"><a href="#readme"><img src=".github/images/card.svg"/></a></p>

<p align="center">
<a href="https://kaos.sh/w/deadline/ci"><img src="https://kaos.sh/w/deadline/ci.svg" alt="GitHub Actions CI Status" /></a>
<a href="https://kaos.sh/r/deadline"><img src="https://kaos.sh/r/deadline.svg" alt="GoReportCard" /></a>
<a href="https://kaos.sh/b/deadline"><img src="https://kaos.sh/b/698e5d36-2465-4266-b3d2-7f58e52d5362.svg" alt="codebeat badge" /></a>
<a href="https://kaos.sh/w/deadline/codeql"><img src="https://kaos.sh/w/deadline/codeql.svg" alt="GitHub Actions CodeQL Status" /></a>
<a href="#license"><img src="https://gh.kaos.st/apache2.svg"></a>
<a href="#license"><img src=".github/images/license.svg"/></a>
</p>

<p align="center"><a href="#installation">Installation</a> • <a href="#usage">Usage</a> • <a href="#build-status">Build Status</a> • <a href="#contributing">Contributing</a> • <a href="#license">License</a></p>
Expand All @@ -24,7 +24,7 @@ To build the `deadline` from scratch, make sure you have a working Go 1.21+ work
go install github.com/essentialkaos/deadline@latest
```

#### From [ESSENTIAL KAOS Public Repository](https://yum.kaos.st)
#### From [ESSENTIAL KAOS Public Repository](https://kaos.sh/kaos-repo)

```bash
sudo yum install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm
Expand All @@ -43,22 +43,7 @@ bash <(curl -fsSL https://apps.kaos.st/get) deadline

### Usage

```
Usage: deadline {options} time:signal command…
Options
--help, -h Show this help message
--version, -v Show version
Examples
deadline 5m my-script.sh arg1 arg2
Run my-script.sh and send TERM signal in 5 minutes
deadline 5m:KILL my-script.sh arg1 arg2
Run my-script.sh and send KILL signal in 5 minutes
```
<p align="center"><img src=".github/images/usage.svg"/></p>

### Build Status

Expand Down
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (

const (
APP = "deadline"
VER = "1.6.1"
VER = "1.6.2"
DESC = "Simple utility for controlling application working time"
)

Expand Down
10 changes: 8 additions & 2 deletions common/deadline.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Summary: Simple utility for controlling application working time
Name: deadline
Version: 1.6.1
Version: 1.6.2
Release: 0%{?dist}
Group: Applications/System
License: Apache 2.0
Expand All @@ -32,7 +32,10 @@ Simple utility for controlling application working time.

%build
if [[ ! -d "%{name}/vendor" ]] ; then
echo "This package requires vendored dependencies"
echo -e "----\nThis package requires vendored dependencies\n----"
exit 1
elif [[ -f "%{name}/%{name}" ]] ; then
echo -e "----\nSources must not contain precompiled binaries\n----"
exit 1
fi

Expand Down Expand Up @@ -60,6 +63,9 @@ rm -rf %{buildroot}
################################################################################

%changelog
* Mon Jun 17 2024 Anton Novojilov <[email protected]> - 1.6.2-0
- Dependencies update

* Fri May 03 2024 Anton Novojilov <[email protected]> - 1.6.1-0
- Improved support information gathering
- Code refactoring
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module github.com/essentialkaos/deadline

go 1.18

require github.com/essentialkaos/ek/v12 v12.126.1

require (
github.com/essentialkaos/depsy v1.3.0
github.com/essentialkaos/ek/v12 v12.121.0
github.com/essentialkaos/depsy v1.3.0 // indirect
golang.org/x/sys v0.21.0 // indirect
)

require golang.org/x/sys v0.19.0 // indirect
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk=
github.com/essentialkaos/depsy v1.3.0 h1:CN7bRgBU2jGTHSkg/Sh38eDUn7cvmaTp2sxFt2HpFeU=
github.com/essentialkaos/depsy v1.3.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8=
github.com/essentialkaos/ek/v12 v12.121.0 h1:Ax/6FsF6mYzT9KSaphqGqrphvMuWslSCIUCrQqWk0v0=
github.com/essentialkaos/ek/v12 v12.121.0/go.mod h1:VUiC4T8afqtE+UzJftTlIypDBKI1s+0nxxNfBhjyIbo=
github.com/essentialkaos/ek/v12 v12.126.1 h1:K4tCpu9T3k5Bv6hJ1lmW7Ou0GxjgjBIKRsoZgAGdEhE=
github.com/essentialkaos/ek/v12 v12.126.1/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=

0 comments on commit cf4ca07

Please sign in to comment.