Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
932d5c380f | |||
f84d76badf | |||
6ee6e10621 | |||
127d38c076 | |||
0218dee76d |
3
.changes/v0.7.1.md
Normal file
3
.changes/v0.7.1.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
## v0.7.1 - 2025-02-14
|
||||||
|
### Fixed
|
||||||
|
* Incorrect local config file loading logic caused files to not be detected
|
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
@ -25,16 +25,15 @@ jobs:
|
|||||||
cache: true
|
cache: true
|
||||||
# More assembly might be required: Docker logins, GPG, etc. It all depends
|
# More assembly might be required: Docker logins, GPG, etc. It all depends
|
||||||
# on your needs.
|
# on your needs.
|
||||||
- name: Get tag
|
- uses: olegtarasov/get-tag@v2.1.4
|
||||||
id: tag
|
id: tagName
|
||||||
uses: dawidd6/action-get-tag@v1
|
|
||||||
with:
|
with:
|
||||||
# Optionally strip `v` prefix
|
# tagRegex: "foobar-(.*)" # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined.
|
||||||
strip_v: false
|
tagRegexGroup: 1 # Optional. Default is 1.
|
||||||
- uses: goreleaser/goreleaser-action@v4
|
- uses: goreleaser/goreleaser-action@v4
|
||||||
with:
|
with:
|
||||||
distribution: goreleaser
|
distribution: goreleaser
|
||||||
version: latest
|
version: latest
|
||||||
args: release --release-notes=".changes/${{steps.tag.outputs.tag}}.md" -f .goreleaser/github.yml --clean
|
args: release --release-notes=".changes/${GIT_TAG_NAME}.md" -f .goreleaser/github.yml --clean
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
|
||||||
|
@ -16,7 +16,7 @@ builds:
|
|||||||
- arm64
|
- arm64
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- format: tar.gz
|
- formats: tar.gz
|
||||||
# this name template makes the OS and Arch compatible with the results of uname.
|
# this name template makes the OS and Arch compatible with the results of uname.
|
||||||
name_template: >-
|
name_template: >-
|
||||||
{{ .ProjectName }}_{{ .Version }}_
|
{{ .ProjectName }}_{{ .Version }}_
|
||||||
@ -28,7 +28,7 @@ archives:
|
|||||||
# use zip for windows archives
|
# use zip for windows archives
|
||||||
format_overrides:
|
format_overrides:
|
||||||
- goos: windows
|
- goos: windows
|
||||||
format: zip
|
formats: zip
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
snapshot:
|
snapshot:
|
||||||
|
@ -17,7 +17,7 @@ builds:
|
|||||||
- arm64
|
- arm64
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
- format: tar.gz
|
- formats: tar.gz
|
||||||
# this name template makes the OS and Arch compatible with the results of uname.
|
# this name template makes the OS and Arch compatible with the results of uname.
|
||||||
name_template: >-
|
name_template: >-
|
||||||
{{ .ProjectName }}_{{ .Version }}_
|
{{ .ProjectName }}_{{ .Version }}_
|
||||||
@ -29,7 +29,7 @@ archives:
|
|||||||
# use zip for windows archives
|
# use zip for windows archives
|
||||||
format_overrides:
|
format_overrides:
|
||||||
- goos: windows
|
- goos: windows
|
||||||
format: zip
|
formats: zip
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
snapshot:
|
snapshot:
|
||||||
|
@ -6,6 +6,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
|||||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
and is generated by [Changie](https://github.com/miniscruff/changie).
|
||||||
|
|
||||||
|
|
||||||
|
## v0.7.1 - 2025-02-14
|
||||||
|
### Fixed
|
||||||
|
* Incorrect local config file loading logic caused files to not be detected
|
||||||
|
|
||||||
## v0.7.0 - 2025-02-11
|
## v0.7.0 - 2025-02-11
|
||||||
### Added
|
### Added
|
||||||
* [feat]: package `packageOperation` option `checkVersion` implemented
|
* [feat]: package `packageOperation` option `checkVersion` implemented
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
const versionStr = "0.7.0"
|
const versionStr = "0.7.1"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
versionCmd = &cobra.Command{
|
versionCmd = &cobra.Command{
|
||||||
|
@ -14,7 +14,7 @@ Usage:
|
|||||||
backy [command]
|
backy [command]
|
||||||
|
|
||||||
Available Commands:
|
Available Commands:
|
||||||
backup Runs commands defined in config file.
|
backup Runs commands defined in config file. Use -l flag multiple times to run multiple lists.
|
||||||
completion Generate the autocompletion script for the specified shell
|
completion Generate the autocompletion script for the specified shell
|
||||||
cron Starts a scheduler that runs lists defined in config file.
|
cron Starts a scheduler that runs lists defined in config file.
|
||||||
exec Runs commands defined in config file in order given.
|
exec Runs commands defined in config file in order given.
|
||||||
@ -23,9 +23,11 @@ Available Commands:
|
|||||||
version Prints the version and exits
|
version Prints the version and exits
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
-f, --config string config file to read from
|
-f, --config string config file to read from
|
||||||
-h, --help help for backy
|
-h, --help help for backy
|
||||||
-v, --verbose Sets verbose level
|
--log-file string log file to write to
|
||||||
|
--s3-endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
|
||||||
|
-v, --verbose Sets verbose level
|
||||||
|
|
||||||
Use "backy [command] --help" for more information about a command.
|
Use "backy [command] --help" for more information about a command.
|
||||||
```
|
```
|
||||||
@ -39,15 +41,17 @@ Backup executes commands defined in config file.
|
|||||||
Use the --lists or -l flag to execute the specified lists. If not flag is not given, all lists will be executed.
|
Use the --lists or -l flag to execute the specified lists. If not flag is not given, all lists will be executed.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
backy backup [--lists=list1,list2,... | -l list1, list2,...] [flags]
|
backy backup [--lists=list1 --lists list2 ... | -l list1 -l list2 ...] [flags]
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
-h, --help help for backup
|
-h, --help help for backup
|
||||||
-l, --lists strings Accepts comma-separated names of command lists to execute.
|
-l, --lists stringArray Accepts comma-separated names of command lists to execute.
|
||||||
|
|
||||||
Global Flags:
|
Global Flags:
|
||||||
-f, --config string config file to read from
|
-f, --config string config file to read from
|
||||||
-v, --verbose Sets verbose level
|
--log-file string log file to write to
|
||||||
|
--s3-endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
|
||||||
|
-v, --verbose Sets verbose level
|
||||||
```
|
```
|
||||||
|
|
||||||
## cron
|
## cron
|
||||||
@ -62,8 +66,10 @@ Flags:
|
|||||||
-h, --help help for cron
|
-h, --help help for cron
|
||||||
|
|
||||||
Global Flags:
|
Global Flags:
|
||||||
-f, --config string config file to read from
|
-f, --config string config file to read from
|
||||||
-v, --verbose Sets verbose level
|
--log-file string log file to write to
|
||||||
|
--s3-endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
|
||||||
|
-v, --verbose Sets verbose level
|
||||||
```
|
```
|
||||||
|
|
||||||
## exec
|
## exec
|
||||||
@ -82,8 +88,10 @@ Flags:
|
|||||||
-h, --help help for exec
|
-h, --help help for exec
|
||||||
|
|
||||||
Global Flags:
|
Global Flags:
|
||||||
-f, --config string config file to read from
|
-f, --config string config file to read from
|
||||||
-v, --verbose Sets verbose level
|
--log-file string log file to write to
|
||||||
|
--s3-endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
|
||||||
|
-v, --verbose Sets verbose level
|
||||||
|
|
||||||
Use "backy exec [command] --help" for more information about a command.
|
Use "backy exec [command] --help" for more information about a command.
|
||||||
```
|
```
|
||||||
@ -95,16 +103,18 @@ Host executes specified commands on the hosts defined in config file.
|
|||||||
Use the --commands or -c flag to choose the commands.
|
Use the --commands or -c flag to choose the commands.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
backy exec host [--commands=command1,command2, ... | -c command1,command2, ...] [--hosts=host1,hosts2, ... | -m host1,host2, ...] [flags]
|
backy exec host [--command=command1 --command=command2 ... | -c command1 -c command2 ...] [--hosts=host1 --hosts=hosts2 ... | -m host1 -m host2 ...] [flags]
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
-c, --commands strings Accepts comma-separated names of commands.
|
-c, --command stringArray Accepts space-separated names of commands. Specify multiple times for multiple commands.
|
||||||
-h, --help help for host
|
-h, --help help for host
|
||||||
-m, --hosts strings Accepts comma-separated names of hosts.
|
-m, --hosts stringArray Accepts space-separated names of hosts. Specify multiple times for multiple hosts.
|
||||||
|
|
||||||
Global Flags:
|
Global Flags:
|
||||||
-f, --config string config file to read from
|
-f, --config string config file to read from
|
||||||
-v, --verbose Sets verbose level
|
--log-file string log file to write to
|
||||||
|
--s3-endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
|
||||||
|
-v, --verbose Sets verbose level
|
||||||
```
|
```
|
||||||
|
|
||||||
## version
|
## version
|
||||||
@ -121,8 +131,10 @@ Flags:
|
|||||||
-V, --vpre Output the version with v prefixed.
|
-V, --vpre Output the version with v prefixed.
|
||||||
|
|
||||||
Global Flags:
|
Global Flags:
|
||||||
-f, --config string config file to read from
|
-f, --config string config file to read from
|
||||||
-v, --verbose Sets verbose level
|
--log-file string log file to write to
|
||||||
|
--s3-endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
|
||||||
|
-v, --verbose Sets verbose level
|
||||||
```
|
```
|
||||||
|
|
||||||
## list
|
## list
|
||||||
@ -140,6 +152,8 @@ Flags:
|
|||||||
-l, --lists strings Accepts comma-separated names of command lists to list.
|
-l, --lists strings Accepts comma-separated names of command lists to list.
|
||||||
|
|
||||||
Global Flags:
|
Global Flags:
|
||||||
-f, --config string config file to read from
|
-f, --config string config file to read from
|
||||||
-v, --verbose Sets verbose level
|
--log-file string log file to write to
|
||||||
|
--s3-endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
|
||||||
|
-v, --verbose Sets verbose level
|
||||||
```
|
```
|
||||||
|
@ -85,7 +85,6 @@ func (opts *ConfigOpts) InitConfig() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logging.ExitWithMSG(fmt.Sprintf("error initializing config fetcher: %v", err), 1, nil)
|
logging.ExitWithMSG(fmt.Sprintf("error initializing config fetcher: %v", err), 1, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.ConfigFilePath != "" {
|
if opts.ConfigFilePath != "" {
|
||||||
loadConfigFile(fetcher, opts.ConfigFilePath, backyKoanf, opts)
|
loadConfigFile(fetcher, opts.ConfigFilePath, backyKoanf, opts)
|
||||||
} else {
|
} else {
|
||||||
@ -109,22 +108,22 @@ func loadConfigFile(fetcher remotefetcher.RemoteFetcher, filePath string, k *koa
|
|||||||
func loadDefaultConfigFiles(fetcher remotefetcher.RemoteFetcher, configFiles []string, k *koanf.Koanf, opts *ConfigOpts) {
|
func loadDefaultConfigFiles(fetcher remotefetcher.RemoteFetcher, configFiles []string, k *koanf.Koanf, opts *ConfigOpts) {
|
||||||
cFileFailures := 0
|
cFileFailures := 0
|
||||||
for _, c := range configFiles {
|
for _, c := range configFiles {
|
||||||
|
opts.ConfigFilePath = c
|
||||||
data, err := fetcher.Fetch(c)
|
data, err := fetcher.Fetch(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cFileFailures++
|
cFileFailures++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := k.Load(rawbytes.Provider(data), yaml.Parser()); err != nil {
|
if data != nil {
|
||||||
cFileFailures++
|
if err := k.Load(rawbytes.Provider(data), yaml.Parser()); err == nil {
|
||||||
continue
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if cFileFailures == len(configFiles) {
|
if cFileFailures == len(configFiles) {
|
||||||
logging.ExitWithMSG("Could not find any valid config file", 1, nil)
|
logging.ExitWithMSG("Could not find any valid local config file", 1, nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
release
5
release
@ -1,9 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -eou pipefail
|
||||||
export CURRENT_TAG="$(go run backy.go version -V)"
|
export CURRENT_TAG="$(go run backy.go version -V)"
|
||||||
|
goreleaser -f .goreleaser/github.yml check
|
||||||
|
goreleaser -f .goreleaser/gitea.yml check
|
||||||
changie batch $CURRENT_TAG
|
changie batch $CURRENT_TAG
|
||||||
changie merge
|
changie merge
|
||||||
git add .changes/
|
git add .changes/
|
||||||
git commit =am "$CURRENT_TAG"
|
git commit -am "$CURRENT_TAG"
|
||||||
git tag "$CURRENT_TAG"
|
git tag "$CURRENT_TAG"
|
||||||
git push all
|
git push all
|
||||||
git push all --tags
|
git push all --tags
|
||||||
|
Reference in New Issue
Block a user