Skip to content

Commit 5688c6b

Browse files
author
Matthew Fisher
committed
feat(builder): inject GIT_SHA into builder apps
1 parent 0a86112 commit 5688c6b

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

builder/templates/builder

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ if [ ! -f Dockerfile ]; then
131131
cp $DOCKERFILE_SHIM ./Dockerfile
132132
fi
133133

134+
# inject builder-specific environment variables into the application environment
135+
echo "ENV GIT_SHA=$GIT_SHA" >> Dockerfile
136+
134137
echo
135138
puts-step "Building Docker image"
136139
docker build -t $TMP_IMAGE . 2>&1

tests/apps_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func appsRunTest(t *testing.T, params *utils.DeisTestConfig) {
9898
t.Fatal(err)
9999
}
100100
utils.Execute(t, cmd, params, false, "hello")
101+
utils.Execute(t, "apps:run env", params, true, "GIT_SHA")
101102
if err := utils.Chdir(".."); err != nil {
102103
t.Fatal(err)
103104
}

0 commit comments

Comments
 (0)