mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-24 23:00:39 +00:00
feat: add env variable DRONE_DOCKER_BUILD_TIME to docker cmd
This commit is contained in:
parent
c746174ca4
commit
0e25852747
@ -5,6 +5,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
@ -106,7 +107,11 @@ func commandBuild(build Build) *exec.Cmd {
|
|||||||
args = append(args, "--platform", strings.Join(build.Platforms.Value()[:], ","))
|
args = append(args, "--platform", strings.Join(build.Platforms.Value()[:], ","))
|
||||||
}
|
}
|
||||||
|
|
||||||
return exec.Command(dockerExe, args...)
|
cmd := exec.Command(dockerExe, args...)
|
||||||
|
copy(os.Environ(), cmd.Env)
|
||||||
|
cmd.Env = append(cmd.Env, fmt.Sprintf("DRONE_DOCKER_BUILD_TIME=%s", time.Now().Format(time.RFC3339)))
|
||||||
|
|
||||||
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper function to add proxy values from the environment
|
// helper function to add proxy values from the environment
|
||||||
|
Loading…
Reference in New Issue
Block a user