Skip to content

Commit

Permalink
fix(lib): Allow overriding "CI" variable (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan93412 authored Aug 17, 2023
1 parent bc21a90 commit 8d9a638
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/zeaburpack/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ func buildImage(opt *buildImageOptions) error {

// build the dockerfile
dockerfileEnv := ""

// Inject CI env so everyone knows that we are a CI.
if _, ok := resolvedVars["CI"]; !ok {
dockerfileEnv += "ENV CI true\n"
}

for _, key := range sortedResolvedVarsKey {
value := resolvedVars[key]

Expand All @@ -56,9 +62,6 @@ func buildImage(opt *buildImageOptions) error {
dockerfileEnv += "ENV " + key + " " + value + "\n"
}

// Inject CI env so everyone knows that we are a CI.
dockerfileEnv += "ENV CI true\n"

for _, stageLine := range stageLines {
lines[stageLine] = lines[stageLine] + "\n" + dockerfileEnv + "\n"
}
Expand Down

0 comments on commit 8d9a638

Please sign in to comment.