diff --git a/README.md b/README.md index a088617..bf49524 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,6 @@ Application Options: -s, --shell= Redefine interactive shell binary (default: bash) --scratchsize= Size of disk backed scratch space -e, --environ-var= Environment variables - --print-recipe Print final recipe - --dry-run Compose final recipe to build but without any real work started ## Description diff --git a/action.go b/action.go index e765180..b934e9b 100644 --- a/action.go +++ b/action.go @@ -53,7 +53,6 @@ type Action interface { // has run for Action. This method is always executed on the host with user's permissions. PostMachineCleanup(context *DebosContext) error String() string - DumpAction() } type BaseAction struct { @@ -82,9 +81,3 @@ func (b *BaseAction) String() string { } return b.Description } -func (b *BaseAction) DumpAction() { - log.Printf(" - action: %s\n", b.Action) - if b.Description != "" { - log.Printf(" description: %s\n", b.Description) - } -} diff --git a/actions/apt_action.go b/actions/apt_action.go index da2e76a..681c069 100644 --- a/actions/apt_action.go +++ b/actions/apt_action.go @@ -21,9 +21,6 @@ Optional properties: package actions import ( - "strings" - "log" - "github.com/go-debos/debos" ) @@ -62,16 +59,3 @@ func (apt *AptAction) Run(context *debos.DebosContext) error { return nil } - -func (apt *AptAction) DumpAction() { - apt.BaseAction.DumpAction() - - // Mandatory properties - s := strings.Join(apt.Packages, ", ") - log.Printf(" packages: [ %s ]\n", s) - - // Optional properties - if apt.Recommends != false { - log.Printf(" recommends: %t\n", apt.Recommends) - } -} diff --git a/actions/debootstrap_action.go b/actions/debootstrap_action.go index f6a285b..02cbb15 100644 --- a/actions/debootstrap_action.go +++ b/actions/debootstrap_action.go @@ -45,7 +45,6 @@ import ( "os" "path" "strings" - "log" "github.com/go-debos/debos" ) @@ -174,34 +173,3 @@ func (d *DebootstrapAction) Run(context *debos.DebosContext) error { return c.Run("apt clean", "/usr/bin/apt-get", "clean") } - -func (d *DebootstrapAction) DumpAction() { - d.BaseAction.DumpAction() - - // Mandatory properties - log.Printf(" suite: %s\n", d.Suite) - - // Optional properties - if d.CheckGpg != true { - log.Printf(" check-gpg: %t\n", d.CheckGpg) - } - if d.Mirror != "" { - log.Printf(" mirror: %s\n", d.Mirror) - } - if d.Variant != "" { - log.Printf(" variant: %s\n", d.Variant) - } - if d.Components != nil { - s := strings.Join(d.Components, ", ") - log.Printf(" components: [ %s ]\n", s) - } - if d.KeyringPackage != "" { - log.Printf(" keyring-package: %s\n", d.KeyringPackage) - } - if d.KeyringFile != "" { - log.Printf(" keyring-file: %s\n", d.KeyringFile) - } - if d.MergedUsr != true { - log.Printf(" merged-usr: %t\n", d.MergedUsr) - } -} diff --git a/actions/download_action.go b/actions/download_action.go index b8f44b6..a4099e7 100644 --- a/actions/download_action.go +++ b/actions/download_action.go @@ -37,7 +37,6 @@ import ( "github.com/go-debos/debos" "net/url" "path" - "log" ) type DownloadAction struct { @@ -167,22 +166,3 @@ func (d *DownloadAction) Run(context *debos.DebosContext) error { return nil } - -func (d *DownloadAction) DumpAction() { - d.BaseAction.DumpAction() - - // Mandatory properties - log.Printf(" url: %s\n", d.Url) - log.Printf(" name: %s\n", d.Name) - - // Optional properties - if d.Filename != "" { - log.Printf(" filename: %s\n", d.Filename) - } - if d.Unpack != false { - log.Printf(" unpack: %t\n", d.Unpack) - } - if d.Compression != "" { - log.Printf(" compression: %s\n", d.Compression) - } -} diff --git a/actions/filesystem_deploy_action.go b/actions/filesystem_deploy_action.go index d4d6f95..af087f1 100644 --- a/actions/filesystem_deploy_action.go +++ b/actions/filesystem_deploy_action.go @@ -138,20 +138,3 @@ func (fd *FilesystemDeployAction) Run(context *debos.DebosContext) error { return nil } - -func (fd *FilesystemDeployAction) DumpAction() { - fd.BaseAction.DumpAction() - - // Mandatory properties - - // Optional properties - if fd.SetupFSTab != true { - log.Printf(" setup-fstab: %t\n", fd.SetupFSTab) - } - if fd.SetupKernelCmdline != true { - log.Printf(" setup-kernel-cmdline: %t\n", fd.SetupKernelCmdline) - } - if fd.AppendKernelCmdline != "" { - log.Printf(" append-kernel-cmdline: %s\n", fd.AppendKernelCmdline) - } -} diff --git a/actions/image_partition_action.go b/actions/image_partition_action.go index fe06db7..fcfd93e 100644 --- a/actions/image_partition_action.go +++ b/actions/image_partition_action.go @@ -513,54 +513,3 @@ func (i *ImagePartitionAction) Verify(context *debos.DebosContext) error { i.size = size return nil } - -func (i *ImagePartitionAction) DumpPartition(part *Partition) { - // Mandatory properties - log.Printf(" - name: %s\n", part.Name) - log.Printf(" fs: %s\n", part.FS) - log.Printf(" start: %s\n", part.Start) - log.Printf(" end: %s\n", part.End) - - // Optional properties - if part.Flags != nil { - s := strings.Join(part.Flags, ", ") - log.Printf(" flags: [ %s ]\n", s) - } -} - -func (i *ImagePartitionAction) DumpMountpoint(m *Mountpoint) { - // Mandatory properties - log.Printf(" - mountpoint: %s\n", m.Mountpoint) - log.Printf(" partition: %s\n", m.Partition) - - // Optional properties - if m.Options != nil { - s := strings.Join( m.Options, ", ") - log.Printf(" options: [ %s ]\n", s) - } - if m.Buildtime != false { - log.Printf(" buildtime: %t\n", m.Buildtime) - } -} - -func (i *ImagePartitionAction) DumpAction() { - i.BaseAction.DumpAction() - - // Mandatory properties - log.Printf(" imagename: %s\n", i.ImageName) - log.Printf(" imagesize: %s\n", i.ImageSize) - log.Printf(" partitiontype: %s\n", i.PartitionType) - if i.GptGap != "" { - log.Printf(" gpt_gap: %s\n", i.GptGap) - } - log.Printf(" partitions:\n") - for idx, _ := range i.Partitions { - i.DumpPartition(&i.Partitions[idx]) - } - log.Printf(" mountpoints:\n") - for idx, _ := range i.Mountpoints { - i.DumpMountpoint(&i.Mountpoints[idx]) - } - - // Optional properties -} diff --git a/actions/ostree_commit_action.go b/actions/ostree_commit_action.go index 9847a21..a0d8333 100644 --- a/actions/ostree_commit_action.go +++ b/actions/ostree_commit_action.go @@ -90,16 +90,3 @@ func (ot *OstreeCommitAction) Run(context *debos.DebosContext) error { return nil } - -func (ot *OstreeCommitAction) DumpAction() { - ot.BaseAction.DumpAction() - - // Mandatory properties - log.Printf(" repository: %s\n", ot.Repository) - log.Printf(" branch: %s\n", ot.Branch) - - // Optional properties - if ot.Subject != "" { - log.Printf(" subject: %s\n", ot.Subject) - } -} diff --git a/actions/ostree_deploy_action.go b/actions/ostree_deploy_action.go index 94706f9..dab2265 100644 --- a/actions/ostree_deploy_action.go +++ b/actions/ostree_deploy_action.go @@ -54,7 +54,6 @@ import ( "path" "runtime" "strings" - "log" "github.com/go-debos/debos" ostree "github.com/sjoerdsimons/ostree-go/pkg/otbuiltin" @@ -196,30 +195,3 @@ func (ot *OstreeDeployAction) Run(context *debos.DebosContext) error { runtime.GC() return nil } - -func (ot *OstreeDeployAction) DumpAction() { - ot.BaseAction.DumpAction() - - // Mandatory properties - log.Printf(" remote_repository: %s\n", ot.RemoteRepository) - log.Printf(" repository: %s\n", ot.Repository) - log.Printf(" os: %s\n", ot.Os) - log.Printf(" branch: %s\n", ot.Branch) - - // Optional properties - if ot.SetupFSTab != true { - log.Printf(" setup-fstab: %t\n", ot.SetupFSTab) - } - if ot.SetupKernelCmdline != true { - log.Printf(" setup-kernel-cmdline: %t\n", ot.SetupKernelCmdline) - } - if ot.AppendKernelCmdline != "" { - log.Printf(" append-kernel-cmdline: %s\n", ot.AppendKernelCmdline) - } - if ot.TlsClientCertPath != "" { - log.Printf(" tls-client-cert-path: %s\n", ot.TlsClientCertPath) - } - if ot.TlsClientKeyPath != "" { - log.Printf(" tls-client-key-path: %s\n", ot.TlsClientKeyPath) - } -} diff --git a/actions/overlay_action.go b/actions/overlay_action.go index 9e5a0ef..f17ecb3 100644 --- a/actions/overlay_action.go +++ b/actions/overlay_action.go @@ -27,7 +27,6 @@ package actions import ( "fmt" "path" - "log" "github.com/go-debos/debos" ) @@ -66,20 +65,3 @@ func (overlay *OverlayAction) Run(context *debos.DebosContext) error { return debos.CopyTree(sourcedir, destination) } - -func (overlay *OverlayAction) DumpAction() { - overlay.BaseAction.DumpAction() - - // Mandatory properties - if overlay.Source != "" { - log.Printf(" source: %s\n", overlay.Source) - } - - // Optional properties - if overlay.Origin != "" { - log.Printf(" origin: %s\n", overlay.Origin) - } - if overlay.Destination != "" { - log.Printf(" destination: %s\n", overlay.Destination) - } -} diff --git a/actions/pack_action.go b/actions/pack_action.go index 07521fc..1cb1af0 100644 --- a/actions/pack_action.go +++ b/actions/pack_action.go @@ -37,15 +37,3 @@ func (pf *PackAction) Run(context *debos.DebosContext) error { log.Printf("Compression to %s\n", outfile) return debos.Command{}.Run("Packing", "tar", "czf", outfile, "-C", context.Rootdir, ".") } - -func (pf *PackAction) DumpAction() { - pf.BaseAction.DumpAction() - - // Mandatory properties - log.Printf(" file: %s\n", pf.File) - if pf.Compression != "" { - log.Printf(" compression: %s\n", pf.Compression) - } - - // Optional properties -} diff --git a/actions/raw_action.go b/actions/raw_action.go index dd10851..af8c31f 100644 --- a/actions/raw_action.go +++ b/actions/raw_action.go @@ -134,19 +134,3 @@ func (raw *RawAction) Run(context *debos.DebosContext) error { return nil } - -func (raw *RawAction) DumpAction() { - raw.BaseAction.DumpAction() - - // Mandatory properties - log.Printf(" origin: %s\n", raw.Origin) - log.Printf(" source: %s\n", raw.Source) - - // Optional properties - if raw.Offset != "" { - log.Printf(" offset: %s\n", raw.Offset) - } - if raw.Partition != "" { - log.Printf(" partition: %s\n", raw.Partition) - } -} diff --git a/actions/run_action.go b/actions/run_action.go index 65e1354..7bae989 100644 --- a/actions/run_action.go +++ b/actions/run_action.go @@ -43,7 +43,6 @@ import ( "github.com/go-debos/fakemachine" "path" "strings" - "log" "github.com/go-debos/debos" ) @@ -144,26 +143,3 @@ func (run *RunAction) PostMachine(context *debos.DebosContext) error { } return run.doRun(*context) } - -func (run *RunAction) DumpAction() { - run.BaseAction.DumpAction() - - // Mandatory properties - if run.Command != "" { - log.Printf(" command: %s\n", run.Command) - } - if run.Script != "" { - log.Printf(" script: %s\n", run.Script) - } - - // Optional properties - if run.Chroot != false { - log.Printf(" chroot: %t\n", run.Chroot) - } - if run.Label != "" { - log.Printf(" label: %s\n", run.Label) - } - if run.PostProcess != false { - log.Printf(" postprocess: %t\n", run.PostProcess) - } -} diff --git a/actions/unpack_action.go b/actions/unpack_action.go index 5c7b6e1..d4993b1 100644 --- a/actions/unpack_action.go +++ b/actions/unpack_action.go @@ -34,7 +34,6 @@ package actions import ( "fmt" - "log" "github.com/go-debos/debos" ) @@ -99,20 +98,3 @@ func (pf *UnpackAction) Run(context *debos.DebosContext) error { return archive.Unpack(context.Rootdir) } - -func (pf *UnpackAction) DumpAction() { - pf.BaseAction.DumpAction() - - // Mandatory properties - if pf.File != "" { - log.Printf(" file: %s\n", pf.File) - } - - // Optional properties - if pf.Origin != "" { - log.Printf(" origin: %s\n", pf.Origin) - } - if pf.Compression != "" { - log.Printf(" compression: %s\n", pf.Compression) - } -} diff --git a/cmd/debos/debos.go b/cmd/debos/debos.go index f4f5756..20f5253 100644 --- a/cmd/debos/debos.go +++ b/cmd/debos/debos.go @@ -68,8 +68,6 @@ func main() { Memory string `short:"m" long:"memory" description:"Amount of memory for build VM (default: 2048MB)"` ShowBoot bool `long:"show-boot" description:"Show boot/console messages from the fake machine"` EnvironVars map[string]string `short:"e" long:"environ-var" description:"Environment variables (use -e VARIABLE:VALUE syntax)"` - PrintRecipe bool `long:"print-recipe" description:"Print final recipe"` - DryRun bool `long:"dry-run" description:"Compose final recipe to build but without any real work started"` } // These are the environment variables that will be detected on the @@ -130,19 +128,6 @@ func main() { return } - if options.PrintRecipe { - log.Printf("architecture: %s\n", r.Architecture) - log.Println("actions:") - for _, a := range r.Actions { - a.DumpAction() - } - } - - if options.DryRun { - log.Printf("==== Recipe done (Dry run) ====") - return - } - /* If fakemachine is supported the outer fake machine will never use the * scratchdir, so just set it to /scratch as a dummy to prevent the * outer debos creating a temporary direction */