@@ -64,11 +64,34 @@ type (
6464
6565 // Plugin defines the Docker plugin parameters.
6666 Plugin struct {
67- Login Login // Docker login configuration
68- Build Build // Docker build configuration
69- Daemon Daemon // Docker daemon configuration
70- Dryrun bool // Docker push is skipped
71- Cleanup bool // Docker purge is enabled
67+ Login Login // Docker login configuration
68+ Build Build // Docker build configuration
69+ Daemon Daemon // Docker daemon configuration
70+ Dryrun bool // Docker push is skipped
71+ Cleanup bool // Docker purge is enabled
72+ CardPath string // Card path to write file to
73+ }
74+
75+ Inspect []struct {
76+ ID string `json:"Id"`
77+ RepoTags []string `json:"RepoTags"`
78+ RepoDigests []interface {} `json:"RepoDigests"`
79+ Parent string `json:"Parent"`
80+ Comment string `json:"Comment"`
81+ Created time.Time `json:"Created"`
82+ Container string `json:"Container"`
83+ DockerVersion string `json:"DockerVersion"`
84+ Author string `json:"Author"`
85+ Architecture string `json:"Architecture"`
86+ Os string `json:"Os"`
87+ Size int `json:"Size"`
88+ VirtualSize int `json:"VirtualSize"`
89+ Metadata struct {
90+ LastTagTime time.Time `json:"LastTagTime"`
91+ } `json:"Metadata"`
92+ SizeString string
93+ VirtualSizeString string
94+ Time string
7295 }
7396)
7497
@@ -157,11 +180,6 @@ func (p Plugin) Exec() error {
157180 }
158181 }
159182
160- if p .Cleanup {
161- cmds = append (cmds , commandRmi (p .Build .Name )) // docker rmi
162- cmds = append (cmds , commandPrune ()) // docker system prune -f
163- }
164-
165183 // execute all commands in batch mode.
166184 for _ , cmd := range cmds {
167185 cmd .Stdout = os .Stdout
@@ -180,6 +198,26 @@ func (p Plugin) Exec() error {
180198 }
181199 }
182200
201+ // output the adaptive card
202+ if err := p .writeCard (); err != nil {
203+ fmt .Printf ("Could not create adaptive card. %s\n " , err )
204+ }
205+
206+ // execute cleanup routines in batch mode
207+ if p .Cleanup {
208+ // clear the slice
209+ cmds = nil
210+
211+ cmds = append (cmds , commandRmi (p .Build .Name )) // docker rmi
212+ cmds = append (cmds , commandPrune ()) // docker system prune -f
213+
214+ for _ , cmd := range cmds {
215+ cmd .Stdout = os .Stdout
216+ cmd .Stderr = os .Stderr
217+ trace (cmd )
218+ }
219+ }
220+
183221 return nil
184222}
185223
0 commit comments