Skip to content

Commit e7e7a41

Browse files
authored
Merge pull request #31 from mittwald/task/add-restic-prune
add restic prune and up deps
2 parents 6359f82 + cc2973c commit e7e7a41

34 files changed

+1095
-623
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build & Test
22

3-
on: [push, pull_request]
3+
on: [push]
44

55
jobs:
66

@@ -10,25 +10,25 @@ jobs:
1010
- uses: actions/checkout@v2
1111

1212
- name: Set up Go
13-
uses: actions/setup-go@v2
13+
uses: actions/setup-go@v4
1414
with:
15-
go-version: 1.15
15+
go-version: "1.20"
1616

1717
- name: Run GoReleaser
1818
uses: goreleaser/goreleaser-action@v2
1919
with:
2020
version: latest
21-
args: release --rm-dist --snapshot --skip-publish -f build/ci/.goreleaser.yml
21+
args: release --clean --snapshot --skip-publish -f build/ci/.goreleaser.yml
2222

2323
test:
2424
runs-on: ubuntu-20.04
2525
steps:
2626
- uses: actions/checkout@v2
2727

2828
- name: Set up Go
29-
uses: actions/setup-go@v2
29+
uses: actions/setup-go@v4
3030
with:
31-
go-version: 1.15
31+
go-version: "1.20"
3232

3333
- name: Install restic
3434
run: |

.github/workflows/release.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414

15+
- name: Set up Go
16+
uses: actions/setup-go@v4
17+
with:
18+
go-version: "1.20"
19+
1520
- run: docker login -u "${{ secrets.QUAY_IO_USER }}" -p "${{ secrets.QUAY_IO_TOKEN }}" quay.io
1621

17-
- run: curl -sL https://git.io/goreleaser | bash -s -- --config build/ci/.goreleaser.yml --rm-dist
22+
- run: curl -sL https://git.io/goreleaser | bash -s -- --config build/ci/.goreleaser.yml --clean
1823
env:
1924
GITHUB_TOKEN: ${{ secrets.RELEASE_USER_TOKEN }}

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
BINARY_NAME = brudi
22
COMMIT_HASH = $(shell git rev-parse --verify HEAD)
33
CURDIR = $(shell pwd)
4-
GOLANGCI_LINT_VER = v1.35.0
54

65
.PHONY: build test
76

@@ -29,20 +28,20 @@ lintci:
2928
docker run --rm \
3029
-v $(CURDIR):/app \
3130
-w /app \
32-
-e GOLANGCI_ADDITIONAL_YML=/app/build/package/ci/.golangci.yml \
33-
quay.io/mittwald/golangci-lint:0.0.8 \
31+
-e GOLANGCI_ADDITIONAL_YML=/app/build/ci/.golangci.yml \
32+
quay.io/mittwald/golangci-lint:0.0.29 \
3433
golangci-lint run -v --fix ./...
3534

3635
lint:
3736
docker run --rm \
3837
-v $(shell go env GOPATH):/go \
3938
-v ${CURDIR}:/app -w /app \
40-
-e GOLANGCI_ADDITIONAL_YML=/app/build/package/ci/.golangci.yml \
41-
quay.io/mittwald/golangci-lint:0.0.8 \
39+
-e GOLANGCI_ADDITIONAL_YML=/app/build/ci/.golangci.yml \
40+
quay.io/mittwald/golangci-lint:0.0.29 \
4241
golangci-lint run -v --fix ./...
4342

4443
goreleaser:
45-
curl -sL https://git.io/goreleaser | bash -s -- --snapshot --skip-publish --rm-dist
44+
curl -sL https://git.io/goreleaser | bash -s -- --debug --snapshot --skip-publish --clean
4645

4746
upTestMongo: downTestMongo
4847
trap 'cd $(CURDIR) && make downTestMongo' 0 1 2 3 6 9 15

build/ci/.golangci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ run:
55
- test/
66
timeout: 10m
77

8+
linters:
9+
disable:
10+
- forcetypeassert
11+
12+
linters-settings:
13+
cyclop:
14+
max-complexity: 15

build/ci/.goreleaser.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
before:
22
hooks:
3-
- go mod download
4-
- make lintci
3+
- go mod tidy
4+
55
builds:
66
-
77
env:
88
- CGO_ENABLED=0
99
binary: brudi
1010
ldflags:
11-
- -s
12-
- -w
13-
- -X 'github.com/mittwald/brudi/cmd.tag={{ .Tag }}'
11+
- -s -w -X 'github.com/mittwald/brudi/cmd.tag={{ .Version }}'
1412
goos:
1513
- darwin
1614
- linux
1715
goarch:
1816
- amd64
19-
archives:
20-
- replacements:
21-
darwin: Darwin
22-
linux: Linux
23-
windows: Windows
24-
386: i386
25-
amd64: x86_64
2617
checksum:
2718
name_template: 'checksums.txt'
2819
snapshot:

build/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.12
1+
FROM alpine:3.18
22

33
LABEL maintainer="Mittwald CM Service <https://github.com/mittwald>"
44

cmd/mongodump.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var (
1919
ctx, cancel := context.WithCancel(context.Background())
2020
defer cancel()
2121

22-
err := source.DoBackupForKind(ctx, mongodump.Kind, cleanup, useRestic, useResticForget)
22+
err := source.DoBackupForKind(ctx, mongodump.Kind, cleanup, useRestic, useResticForget, useResticPrune)
2323
if err != nil {
2424
panic(err)
2525
}

cmd/mongorestore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var (
1919
ctx, cancel := context.WithCancel(context.Background())
2020
defer cancel()
2121

22-
err := source.DoRestoreForKind(ctx, mongorestore.Kind, cleanup, useRestic, useResticForget)
22+
err := source.DoRestoreForKind(ctx, mongorestore.Kind, cleanup, useRestic)
2323
if err != nil {
2424
panic(err)
2525
}

cmd/mysqldump.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var (
1818
ctx, cancel := context.WithCancel(context.Background())
1919
defer cancel()
2020

21-
err := source.DoBackupForKind(ctx, mysqldump.Kind, cleanup, useRestic, useResticForget)
21+
err := source.DoBackupForKind(ctx, mysqldump.Kind, cleanup, useRestic, useResticForget, useResticPrune)
2222
if err != nil {
2323
panic(err)
2424
}

cmd/mysqlrestore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var (
1818
ctx, cancel := context.WithCancel(context.Background())
1919
defer cancel()
2020

21-
err := source.DoRestoreForKind(ctx, mysqlrestore.Kind, cleanup, useRestic, useResticForget)
21+
err := source.DoRestoreForKind(ctx, mysqlrestore.Kind, cleanup, useRestic)
2222
if err != nil {
2323
panic(err)
2424
}

0 commit comments

Comments
 (0)