Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit 71af83a

Browse files
proxy for lazy loading of all gitlab ci variables
1 parent b565712 commit 71af83a

File tree

5 files changed

+85
-53
lines changed

5 files changed

+85
-53
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
* `PredefinedVariables` return in all cases a proxy object, which calls `os.environ` or `os.getenv` as late as possible.
11+
This helps when overriding (monkeypatching) variables in pytestes.
12+
1013
## [0.6.0] - 2021-04-06
1114

1215
### Added

gcip/addons/container/jobs/kaniko.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
__copyright__ = "Copyright 2020 DB Systel GmbH"
1010
__credits__ = ["Daniel von Eßen", "Thomas Steinbach"]
1111
# SPDX-License-Identifier: Apache-2.0
12-
__license__ = 'Apache-2.0'
13-
__maintainer__ = 'Thomas Steinbach'
14-
__email__ = 'thomas.t.steinbach@deutschebahn.com'
12+
__license__ = "Apache-2.0"
13+
__maintainer__ = "Thomas Steinbach"
14+
__email__ = "thomas.t.steinbach@deutschebahn.com"
1515

1616

1717
def execute(
@@ -150,8 +150,11 @@ def execute(
150150

151151
if registry_user_env_var and registry_login_env_var:
152152
job.prepend_scripts(
153-
'mkdir -p /kaniko/.docker && echo "{\\"auths\\":{\\"https://index.docker.io/v1/\\":{\\"username\\":\\"$' +
154-
registry_user_env_var + '\\",\\"password\\":\\"$' + registry_login_env_var + '\\"}}}" > /kaniko/.docker/config.json'
153+
'mkdir -p /kaniko/.docker && echo "{\\"auths\\":{\\"https://index.docker.io/v1/\\":{\\"username\\":\\"$'
154+
+ registry_user_env_var
155+
+ '\\",\\"password\\":\\"$'
156+
+ registry_login_env_var
157+
+ '\\"}}}" > /kaniko/.docker/config.json'
155158
)
156159

157160
job.append_scripts(" ".join(executor_cmd))

0 commit comments

Comments
 (0)