Commit f118acc5 authored by Kamil Trzciński's avatar Kamil Trzciński 💬

Fix regression when variables were not passed to service container

parent 21b04798
Pipeline #291100 failed with stage
v 0.7.2
- Use absolute path when executing archive command
- Fix regression when variables were not passed to service container
v 0.7.1
- Fix caching support
......
......@@ -253,19 +253,19 @@ func (b *Build) String() string {
func (b *Build) GetDefaultVariables() BuildVariables {
return BuildVariables{
{"CI", "true", true},
{"CI_BUILD_REF", b.Sha, true},
{"CI_BUILD_BEFORE_SHA", b.BeforeSha, true},
{"CI_BUILD_REF_NAME", b.RefName, true},
{"CI_BUILD_ID", strconv.Itoa(b.ID), true},
{"CI_BUILD_REPO", b.RepoURL, true},
{"CI_PROJECT_ID", strconv.Itoa(b.ProjectID), true},
{"CI_PROJECT_DIR", b.FullProjectDir(), true},
{"CI_SERVER", "yes", true},
{"CI_SERVER_NAME", "GitLab CI", true},
{"CI_SERVER_VERSION", "", true},
{"CI_SERVER_REVISION", "", true},
{"GITLAB_CI", "true", true},
{"CI", "true", true, true},
{"CI_BUILD_REF", b.Sha, true, true},
{"CI_BUILD_BEFORE_SHA", b.BeforeSha, true, true},
{"CI_BUILD_REF_NAME", b.RefName, true, true},
{"CI_BUILD_ID", strconv.Itoa(b.ID), true, true},
{"CI_BUILD_REPO", b.RepoURL, true, true},
{"CI_PROJECT_ID", strconv.Itoa(b.ProjectID), true, true},
{"CI_PROJECT_DIR", b.FullProjectDir(), true, true},
{"CI_SERVER", "yes", true, true},
{"CI_SERVER_NAME", "GitLab CI", true, true},
{"CI_SERVER_VERSION", "", true, true},
{"CI_SERVER_REVISION", "", true, true},
{"GITLAB_CI", "true", true, true},
}
}
......
......@@ -93,6 +93,7 @@ func (c *RunnerConfig) GetVariables() BuildVariables {
for _, environment := range c.Environment {
if variable, err := ParseVariable(environment); err == nil {
variable.Internal = true
variables = append(variables, variable)
}
}
......
......@@ -8,9 +8,10 @@ import (
)
type BuildVariable struct {
Key string `json:"key"`
Value string `json:"value"`
Public bool `json:"public"`
Key string `json:"key"`
Value string `json:"value"`
Public bool `json:"public"`
Internal bool `json:"-"`
}
type BuildVariables []BuildVariable
......@@ -19,9 +20,9 @@ func (b BuildVariable) String() string {
return fmt.Sprintf("%s=%s", b.Key, b.Value)
}
func (b BuildVariables) Public() (variables BuildVariables) {
func (b BuildVariables) PublicOrInternal() (variables BuildVariables) {
for _, variable := range b {
if variable.Public {
if variable.Public || variable.Internal {
variables = append(variables, variable)
}
}
......
......@@ -36,7 +36,7 @@ type DockerExecutor struct {
}
func (s *DockerExecutor) getServiceVariables() []string {
return s.Build.GetAllVariables().Public().StringList()
return s.Build.GetAllVariables().PublicOrInternal().StringList()
}
func (s *DockerExecutor) getAuthConfig(imageName string) (docker.AuthConfiguration, error) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment