Support variable interpolation at pipeline generation time
This commit is contained in:
parent
ace52bd476
commit
2386f7582a
@ -7,6 +7,7 @@
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import tempfile
|
||||
import zlib
|
||||
@ -40,6 +41,8 @@
|
||||
spack_gpg = SpackCommand('gpg')
|
||||
spack_compiler = SpackCommand('compiler')
|
||||
|
||||
runner_var_regex = re.compile('\\$env:(.+)$')
|
||||
|
||||
|
||||
class TemporaryDirectory(object):
|
||||
def __init__(self):
|
||||
@ -575,6 +578,13 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
|
||||
variables = {}
|
||||
if 'variables' in runner_attribs:
|
||||
variables.update(runner_attribs['variables'])
|
||||
for name, value in variables.items():
|
||||
m = runner_var_regex.search(value)
|
||||
if m:
|
||||
env_var = m.group(1)
|
||||
interp_value = os.environ.get(env_var, None)
|
||||
if interp_value:
|
||||
variables[name] = interp_value
|
||||
|
||||
image_name = None
|
||||
image_entry = None
|
||||
|
Loading…
Reference in New Issue
Block a user