diff options
| author | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-10-27 18:59:35 -0600 |
|---|---|---|
| committer | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-10-27 18:59:35 -0600 |
| commit | d667ad306808fd5d751dcc9f170317d4f8df3ddf (patch) | |
| tree | 4034eb0227c76d83c369efa91094463cf99b634a /ci-script.py | |
| parent | 5a50670ea0edd45836f913d9a40077aea79bd3fe (diff) | |
jenkins scripting
Diffstat (limited to 'ci-script.py')
| -rwxr-xr-x | ci-script.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ci-script.py b/ci-script.py index e62d3da..5a0ffe1 100755 --- a/ci-script.py +++ b/ci-script.py @@ -33,9 +33,10 @@ def check_image_tag_current(glance, manifest): return image and str(manifest["tag"]) in image.tags -def create_image(manifest): +def create_image(env, manifest): cmd = "disk-image-create %s -t %s -o /tmp/%s.%s 2>&1" % (manifest["elements"], manifest["image_type"], manifest["image_name"], manifest["image_type"]) - env = manifest["extra_envs"] if "extra_envs" in manifest else None + env = manifest["extra_envs"] if "extra_envs" in manifest else {} + env["ELEMENTS_PATH"] = env.elements_path p = subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) out, err = p.communicate() if p.returncode != 0: @@ -59,7 +60,7 @@ def main(args): glance = Glance(keystone, endpoint_type="publicURL") for image_name, manifest in manifests.items(): if not check_image_tag_current(glance, manifest): - create_image(manifest) + create_image(env, manifest) glance.upload("%s.%s" % (manifest["image_name"], manifest["image_type"]), manifest["image_type"], "/tmp/%s.%s" % (manifest["image_name"], manifest["image_type"]), |
