Génération de l'image avec mise en cache

This commit is contained in:
2017-01-24 23:15:13 +01:00
parent 82fb9d31e1
commit ce05d9a339
7 changed files with 62 additions and 112 deletions

View File

@ -1,6 +1,16 @@
import os, glob, subprocess, configparser
import web, system
def run_profile_hooks(profile, step, cwd=None, env=None):
hooks_dir = get_hooks_dir()
step_hooks = profile[step]["hooks"].split(",")
for hook_name in step_hooks:
hook_path = os.path.join(hooks_dir, hook_name)
subprocess.call(hook_path, cwd=cwd, stdin=subprocess.PIPE, env=env)
def get_hooks_dir():
return os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + "/../hooks")
def load_profile(profile_name):
profile_filename = profile_name+".conf"
for profile_file in get_available_profiles():
@ -41,10 +51,6 @@ def get_rkt_achive_dest_dir():
workspace_tmp = get_workspace_subdir('tmp')
return glob.glob(os.path.join(os.sep, workspace_tmp, 'rkt-v*'))[0]
def get_acbuild_workspace_dir():
"""Return the current path (linked to the process pid) to the acbuild workspace"""
return get_workspace_subdir("tmp/build_{:d}".format(os.getpid()))
def download_rkt():
"""Download a local copy of rkt in the tamarin workspace and return the absolute path to the archive"""
url = "https://github.com/coreos/rkt/releases/download/v1.22.0/rkt-v1.22.0.tar.gz"