forked from mittwald/brudi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/mittwald/brudi into mittw…
…ald#19/AdditionalResticFunctionality
- Loading branch information
Showing
56 changed files
with
3,487 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Go | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15 | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist --snapshot --skip-publish -f build/ci/.goreleaser.yml | ||
|
||
test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15 | ||
|
||
- name: Install restic | ||
run: | | ||
wget https://github.com/restic/restic/releases/download/v0.11.0/restic_0.11.0_linux_amd64.bz2 | ||
bzip2 -d restic_0.11.0_linux_amd64.bz2 | ||
sudo mv restic_0.11.0_linux_amd64 /usr/local/bin/restic | ||
sudo chown root:root /usr/local/bin/restic | ||
sudo chmod +x /usr/local/bin/restic | ||
- name: install redis-cli | ||
run: sudo apt-get install redis-tools | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
env: | ||
RESTIC_PASSWORD: mongorepo |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,3 +80,4 @@ run: | |
- example/ | ||
- .github/ | ||
- dist/ | ||
- test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
before: | ||
hooks: | ||
- go mod download | ||
- make test | ||
- make lint | ||
builds: | ||
- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cmd | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/mittwald/brudi/pkg/source" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/mittwald/brudi/pkg/source/mongorestore" | ||
) | ||
|
||
var ( | ||
mongoRestoreCmd = &cobra.Command{ | ||
Use: "mongorestore", | ||
Short: "restores from mongodump ", | ||
Long: "Restores a given database server with given arguments", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
ctx, cancel := context.WithCancel(context.Background()) | ||
defer cancel() | ||
|
||
err := source.DoRestoreForKind(ctx, mongorestore.Kind, cleanup, useRestic, useResticForget) | ||
if err != nil { | ||
panic(err) | ||
} | ||
}, | ||
} | ||
) | ||
|
||
func init() { | ||
rootCmd.AddCommand(mongoRestoreCmd) | ||
} |
Oops, something went wrong.