Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 9513f50

Browse files
Add upgrade command to the docker app lifecycle
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
1 parent 62b6a2f commit 9513f50

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

e2e/commands_test.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func TestBundle(t *testing.T) {
328328
assert.Assert(t, fs.Equal(tmpDir.Join("simple.dockerapp"), manifest))
329329
}
330330

331-
func TestDeployDockerApp(t *testing.T) {
331+
func TestDockerAppLifecycle(t *testing.T) {
332332
tmpDir := fs.NewDir(t, t.Name())
333333
defer tmpDir.Remove()
334334

@@ -400,6 +400,19 @@ func TestDeployDockerApp(t *testing.T) {
400400
fmt.Sprintf("[[:alnum:]]+ %s_api replicated [0-1]/1 python:3.6", t.Name()),
401401
})
402402

403+
// Upgrade the application, changing the port
404+
cmd.Command = []string{dockerApp, "upgrade", t.Name(), "--set", "web_port=8081"}
405+
checkContains(t, icmd.RunCmd(cmd).Assert(t, icmd.Success).Combined(),
406+
[]string{
407+
fmt.Sprintf("Updating service %s_db", t.Name()),
408+
fmt.Sprintf("Updating service %s_api", t.Name()),
409+
fmt.Sprintf("Updating service %s_web", t.Name()),
410+
})
411+
412+
// Query the application status again, the port should have change
413+
cmd.Command = []string{dockerApp, "status", t.Name()}
414+
icmd.RunCmd(cmd).Assert(t, icmd.Expected{ExitCode: 0, Out: "8081"})
415+
403416
// Uninstall the application
404417
cmd.Command = []string{dockerApp, "uninstall", t.Name()}
405418
checkContains(t, icmd.RunCmd(cmd).Assert(t, icmd.Success).Combined(),

0 commit comments

Comments
 (0)