mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-05 05:20:34 +00:00
Merge branch 'queeno-add_config_show_command-2'
This commit is contained in:
@@ -65,6 +65,7 @@ fine-grained changes in repository contents to transition your
|
||||
package environment to new version.`,
|
||||
Flag: *flag.NewFlagSet("aptly", flag.ExitOnError),
|
||||
Subcommands: []*commander.Command{
|
||||
makeCmdConfig(),
|
||||
makeCmdDb(),
|
||||
makeCmdGraph(),
|
||||
makeCmdMirror(),
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/smira/commander"
|
||||
)
|
||||
|
||||
func makeCmdConfig() *commander.Command {
|
||||
return &commander.Command{
|
||||
UsageLine: "config",
|
||||
Short: "manage aptly configuration",
|
||||
Subcommands: []*commander.Command{
|
||||
makeCmdConfigShow(),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/smira/commander"
|
||||
)
|
||||
|
||||
func aptlyConfigShow(cmd *commander.Command, args []string) error {
|
||||
|
||||
config := context.Config()
|
||||
prettyJSON, err := json.MarshalIndent(config, "", " ")
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to dump the config file: %s", err)
|
||||
}
|
||||
|
||||
fmt.Println(string(prettyJSON))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func makeCmdConfigShow() *commander.Command {
|
||||
cmd := &commander.Command{
|
||||
Run: aptlyConfigShow,
|
||||
UsageLine: "show",
|
||||
Short: "show current aptly's config",
|
||||
Long: `
|
||||
Command show displays the current aptly configuration.
|
||||
|
||||
Example:
|
||||
|
||||
$ aptly config show
|
||||
|
||||
`,
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
+7
-7
@@ -133,16 +133,16 @@ func makeCmdTaskRun() *commander.Command {
|
||||
UsageLine: "run -filename=<filename> | <command1>, <command2>, ...",
|
||||
Short: "run aptly tasks",
|
||||
Long: `
|
||||
Command helps origanise multiple aptly commands in one single aptly task, running as single thread.
|
||||
Command helps organise multiple aptly commands in one single aptly task, running as single thread.
|
||||
|
||||
Example:
|
||||
|
||||
$ aptly task run
|
||||
> repo create local
|
||||
> repo add local pkg1
|
||||
> publish repo local
|
||||
> serve
|
||||
>
|
||||
$ aptly task run
|
||||
> repo create local
|
||||
> repo add local pkg1
|
||||
> publish repo local
|
||||
> serve
|
||||
>
|
||||
|
||||
`,
|
||||
}
|
||||
|
||||
+43
@@ -1464,6 +1464,49 @@ Example:
|
||||
.P
|
||||
$ aptly graph
|
||||
.
|
||||
.SH "SHOW CURRENT APTLY\(cqS CONFIG"
|
||||
\fBaptly\fR \fBconfig\fR \fBshow\fR
|
||||
.
|
||||
.P
|
||||
Command show displays the current aptly configuration\.
|
||||
.
|
||||
.P
|
||||
Example:
|
||||
.
|
||||
.P
|
||||
$ aptly config show
|
||||
.
|
||||
.SH "RUN APTLY TASKS"
|
||||
\fBaptly\fR \fBtask\fR \fBrun\fR \-filename=\fIfilename\fR \fB|\fR \fIcommand1\fR, \fIcommand2\fR, \fB\|\.\|\.\|\.\fR
|
||||
.
|
||||
.P
|
||||
Command helps organise multiple aptly commands in one single aptly task, running as single thread\.
|
||||
.
|
||||
.P
|
||||
Example:
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
$ aptly task run
|
||||
> repo create local
|
||||
> repo add local pkg1
|
||||
> publish repo local
|
||||
> serve
|
||||
>
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Options:
|
||||
.
|
||||
.TP
|
||||
\-\fBfilename\fR=
|
||||
specifies the filename that contains the commands to run
|
||||
.
|
||||
.SH "ENVIRONMENT"
|
||||
If environment variable \fBHTTP_PROXY\fR is set \fBaptly\fR would use its value to proxy all HTTP requests\.
|
||||
.
|
||||
|
||||
@@ -245,6 +245,10 @@ When specified on command line, query may have to be quoted according to shell r
|
||||
|
||||
{{template "command" findCommand . "graph"}}
|
||||
|
||||
{{template "command" findCommand . "config"}}
|
||||
|
||||
{{template "command" findCommand . "task"}}
|
||||
|
||||
## ENVIRONMENT
|
||||
|
||||
If environment variable `HTTP_PROXY` is set `aptly` would use its value
|
||||
|
||||
@@ -3,6 +3,7 @@ aptly - Debian repository management tool
|
||||
Commands:
|
||||
|
||||
api start API server/issue requests
|
||||
config manage aptly configuration
|
||||
db manage aptly's internal database and package pool
|
||||
graph render graph of relationships
|
||||
mirror manage mirrors of remote repositories
|
||||
|
||||
Reference in New Issue
Block a user