mirror of
https://github.com/outbackdingo/debos.git
synced 2026-01-27 18:18:45 +00:00
Revert "cmd: Add options to print recipe used for build"
This reverts commit 9522b3bfc6485289516fd5ced7f08f79cd2d8df2.
This commit is contained in:
committed by
Sjoerd Simons
parent
9db472dc14
commit
3cac6f8bb3
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user