From f8e77dfb3de50b3c4f0f8c852389a6ed5bcbcd6e Mon Sep 17 00:00:00 2001 From: "Daniel, Dao Quang Minh" Date: Mon, 29 Sep 2014 04:03:56 -0400 Subject: [PATCH] pass --change changes to the commit job Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh (github: dqminh) Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh (github: rhatdan) --- api/client/commands.go | 3 +++ api/server/server.go | 1 + 2 files changed, 4 insertions(+) diff --git a/api/client/commands.go b/api/client/commands.go index 9776936506..f25b6bbb43 100644 --- a/api/client/commands.go +++ b/api/client/commands.go @@ -1702,6 +1702,8 @@ func (cli *DockerCli) CmdCommit(args ...string) error { flPause := cmd.Bool([]string{"p", "-pause"}, true, "Pause container during commit") flComment := cmd.String([]string{"m", "-message"}, "", "Commit message") flAuthor := cmd.String([]string{"a", "#author", "-author"}, "", "Author (e.g., \"John Hannibal Smith \")") + flChanges := opts.NewListOpts(nil) + cmd.Var(&flChanges, []string{"c", "-change"}, "Apply a modification before committing the image") // FIXME: --run is deprecated, it will be replaced with inline Dockerfile commands. flConfig := cmd.String([]string{"#run", "#-run"}, "", "This option is deprecated and will be removed in a future version in favor of inline Dockerfile-compatible commands") cmd.Require(flag.Max, 2) @@ -1726,6 +1728,7 @@ func (cli *DockerCli) CmdCommit(args ...string) error { v.Set("tag", tag) v.Set("comment", *flComment) v.Set("author", *flAuthor) + v.Set("changes", strings.Join(flChanges.GetAll(), "\n")) if *flPause != true { v.Set("pause", "0") diff --git a/api/server/server.go b/api/server/server.go index 78ca4b7829..ef6951c691 100644 --- a/api/server/server.go +++ b/api/server/server.go @@ -518,6 +518,7 @@ func postCommit(eng *engine.Engine, version version.Version, w http.ResponseWrit job.Setenv("tag", r.Form.Get("tag")) job.Setenv("author", r.Form.Get("author")) job.Setenv("comment", r.Form.Get("comment")) + job.Setenv("changes", r.Form.Get("changes")) job.SetenvSubEnv("config", &config) job.Stdout.Add(stdoutBuffer)