File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 66 "fmt"
77 "maps"
88 "os"
9+ "os/exec"
910 "slices"
1011
1112 "github.com/spf13/cobra"
6869 fmt .Printf ("Version: %s\n " , manifest .Version )
6970 fmt .Printf ("TEE: %s\n " , manifest .TEE )
7071 fmt .Printf ("Kind: %s\n " , manifest .Kind )
72+ fmt .Println ()
7173
7274 switch deployment .Debug {
7375 case true :
@@ -104,6 +106,24 @@ var (
104106 )
105107 containerEnv .AddDirectory (tmpDir )
106108 buildEnv = containerEnv
109+
110+ if buildEnv .IsAvailable () {
111+ fmt .Printf ("Initializing build environment...\n " )
112+ // Run a dummy command to make sure that all necessary Docker layers
113+ // for the build environment are downloaded at the start instead of
114+ // later in the build process.
115+ // Also pipe all output from the process to stdout/stderr, so the user
116+ // can follow the progress in real-time.
117+ cmd := exec .Command ("true" )
118+ cmd .Stdout = os .Stdout
119+ cmd .Stderr = os .Stderr
120+ if err = buildEnv .WrapCommand (cmd ); err != nil {
121+ return fmt .Errorf ("unable to wrap command: %w" , err )
122+ }
123+ if err = cmd .Run (); err != nil {
124+ return fmt .Errorf ("failed to initialize build environment: %w" , err )
125+ }
126+ }
107127 }
108128
109129 if ! buildEnv .IsAvailable () {
You can’t perform that action at this time.
0 commit comments