Skip to content

Commit

Permalink
Make some more environment variables available
Browse files Browse the repository at this point in the history
  • Loading branch information
jocgir committed Nov 30, 2017
1 parent fc7320c commit 4559aa7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"strings"
"syscall"

"github.com/blang/semver"
"github.com/fatih/color"
"github.com/gruntwork-io/terragrunt/util"
)
Expand Down Expand Up @@ -80,8 +81,13 @@ func callDocker(args ...string) int {
os.Setenv("TGF_COMMAND", config.EntryPoint)
os.Setenv("TGF_VERSION", version)
os.Setenv("TGF_IMAGE", config.Image)
os.Setenv("TGF_ARGS", strings.Join(os.Args, " "))
os.Setenv("TGF_LAUNCH_FOLDER", Must(os.Getwd()).(string))
if config.ImageVersion != nil {
os.Setenv("TGF_IMAGE_VERSION", *config.ImageVersion)
if version, err := semver.Make(*config.ImageVersion); err == nil {
os.Setenv("TGF_MAJ_MIN", fmt.Sprintf("%d.%d", version.Major, version.Minor))
}
}
if config.ImageTag != nil {
os.Setenv("TGF_IMAGE_TAG", *config.ImageTag)
Expand Down

0 comments on commit 4559aa7

Please sign in to comment.