-
Notifications
You must be signed in to change notification settings - Fork 7
Vault cli #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Vault cli #278
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e4fafbb
refactor update property, renamed to filter-mode property
8ddf89b
minor
4c337e3
Merge branch 'vault-cli' of github.com:wttech/aemc into vault-cli
921bda2
Merge branch 'main' into vault-cli
dominik-przybyl-wttech 766481d
minor
0777d4d
Merge branch 'vault-cli' of github.com:wttech/aemc into vault-cli
5c8d72c
minor
820ff74
minor
3f06074
Merge remote-tracking branch 'origin/main' into vault-cli
krystian-panek-vmltech 3aa031b
Minor
krystian-panek-vmltech f7f4a7e
fixed pull command
0f08cec
Merge branch 'vault-cli' of github.com:wttech/aemc into vault-cli
5112e43
renamed shorten aliases from filter-roots, filter-file properties
ed783dd
fixed content command properties
f1952fc
minor
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -76,16 +76,16 @@ func (c *CLI) contentDownloadCmd() *cobra.Command { | |
c.Error(err) | ||
return | ||
} | ||
pid, _ := cmd.Flags().GetString("pid") | ||
if pid == "" { | ||
pid = fmt.Sprintf("aemc:content-download:%s-SNAPSHOT", timex.FileTimestampForNow()) | ||
targetPID, _ := cmd.Flags().GetString("target-pid") | ||
if targetPID == "" { | ||
targetPID = fmt.Sprintf("aemc:content-download:%s-SNAPSHOT", timex.FileTimestampForNow()) | ||
} | ||
targetFile, _ := cmd.Flags().GetString("target-file") | ||
filterRoots := determineFilterRoots(cmd) | ||
filterFile, _ := cmd.Flags().GetString("filter-file") | ||
clean, _ := cmd.Flags().GetBool("clean") | ||
if err = c.aem.ContentManager().Download(instance, targetFile, clean, pkg.PackageCreateOpts{ | ||
PID: pid, | ||
PID: targetPID, | ||
FilterRoots: filterRoots, | ||
FilterFile: filterFile, | ||
}); err != nil { | ||
|
@@ -96,13 +96,13 @@ func (c *CLI) contentDownloadCmd() *cobra.Command { | |
c.Changed("content downloaded") | ||
}, | ||
} | ||
cmd.Flags().String("pid", "", "ID (group:name:version) for downloaded package") | ||
cmd.Flags().StringP("target-file", "t", "", "Target file path for downloaded package") | ||
cmd.Flags().StringP("target-pid", "p", "", "ID (group:name:version) for downloaded package") | ||
cmd.Flags().StringP("target-file", "t", "", "File path for downloaded package") | ||
_ = cmd.MarkFlagRequired("target-file") | ||
cmd.Flags().StringSliceP("filter-roots", "r", []string{}, "Vault filter root paths") | ||
cmd.Flags().StringP("filter-file", "f", "", "Vault filter file path") | ||
cmd.Flags().StringSliceP("filter-roots", "g", []string{}, "Vault filter root paths") | ||
cmd.Flags().StringP("filter-file", "h", "", "Vault filter file path") | ||
cmd.MarkFlagsOneRequired("filter-roots", "filter-file") | ||
cmd.Flags().Bool("clean", false, "Normalize content after downloading") | ||
cmd.Flags().BoolP("clean", "c", false, "Normalize content after downloading") | ||
return cmd | ||
} | ||
|
||
|
@@ -157,14 +157,14 @@ func (c *CLI) contentPullCmd() *cobra.Command { | |
}, | ||
} | ||
cmd.Flags().StringP("dir", "d", "", "JCR root path") | ||
cmd.Flags().String("file", "", "Local file path") | ||
cmd.Flags().StringP("file", "f", "", "Local file path") | ||
cmd.Flags().StringP("path", "p", "", "JCR root path or local file path") | ||
cmd.MarkFlagsMutuallyExclusive("dir", "file", "path") | ||
cmd.Flags().StringSliceP("filter-roots", "r", []string{}, "Vault filter root paths") | ||
cmd.Flags().StringP("filter-file", "f", "", "Vault filter file path") | ||
cmd.MarkFlagsOneRequired("dir", "file", "path") | ||
cmd.Flags().StringSliceP("filter-roots", "g", []string{}, "Vault filter root paths") | ||
cmd.Flags().StringP("filter-file", "h", "", "Vault filter file path") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "h" should be reserved for help |
||
cmd.MarkFlagsMutuallyExclusive("filter-roots", "filter-file") | ||
cmd.Flags().Bool("clean", false, "Normalize content after downloading") | ||
cmd.Flags().Bool("replace", false, "Replace content after downloading") | ||
cmd.Flags().BoolP("clean", "c", false, "Normalize content after downloading") | ||
cmd.Flags().BoolP("replace", "r", false, "Replace content after downloading") | ||
return cmd | ||
} | ||
|
||
|
@@ -200,7 +200,7 @@ func (c *CLI) contentPushCmd() *cobra.Command { | |
filterRoots := determineFilterRoots(cmd) | ||
filterRootExcludes := determineFilterRootExcludes(cmd) | ||
clean, _ := cmd.Flags().GetBool("clean") | ||
filterMode := determineFilterMode(cmd) | ||
filterMode, _ := cmd.Flags().GetString("filter-mode") | ||
if err = c.aem.ContentManager().Push(instances, clean, pkg.PackageCreateOpts{ | ||
PID: fmt.Sprintf("aemc:content-push:%s-SNAPSHOT", timex.FileTimestampForNow()), | ||
FilterRoots: filterRoots, | ||
|
@@ -223,8 +223,8 @@ func (c *CLI) contentPushCmd() *cobra.Command { | |
cmd.Flags().StringP("file", "f", "", "Local file path") | ||
cmd.Flags().StringP("path", "p", "", "JCR root path or local file path") | ||
cmd.MarkFlagsOneRequired("dir", "file", "path") | ||
cmd.Flags().Bool("clean", false, "Normalize content while uploading") | ||
cmd.Flags().Bool("update", false, "Existing content on running instance is updated, new content is added and none is deleted") | ||
cmd.Flags().BoolP("clean", "c", false, "Normalize content while uploading") | ||
cmd.Flags().StringP("filter-mode", "m", "", "Override default filter model") | ||
return cmd | ||
} | ||
|
||
|
@@ -261,10 +261,10 @@ func (c *CLI) contentCopyCmd() *cobra.Command { | |
cmd.Flags().StringSliceP("instance-target-url", "u", []string{}, "Destination instance URL") | ||
cmd.Flags().StringSliceP("instance-target-id", "i", []string{}, "Destination instance ID") | ||
cmd.MarkFlagsOneRequired("instance-target-url", "instance-target-id") | ||
cmd.Flags().StringSliceP("filter-roots", "r", []string{}, "Vault filter root paths") | ||
cmd.Flags().StringP("filter-file", "f", "", "Vault filter file path") | ||
cmd.Flags().StringSliceP("filter-roots", "g", []string{}, "Vault filter root paths") | ||
cmd.Flags().StringP("filter-file", "h", "", "Vault filter file path") | ||
cmd.MarkFlagsOneRequired("filter-roots", "filter-file") | ||
cmd.Flags().Bool("clean", false, "Normalize content while copying") | ||
cmd.Flags().BoolP("clean", "c", false, "Normalize content while copying") | ||
return cmd | ||
} | ||
|
||
|
@@ -373,11 +373,3 @@ func determineFilterRootExcludes(cmd *cobra.Command) []string { | |
} | ||
return filterRootExcludes | ||
} | ||
|
||
func determineFilterMode(cmd *cobra.Command) string { | ||
update, _ := cmd.Flags().GetBool("update") | ||
if update { | ||
return "update" | ||
} | ||
return "" | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.