POC fonctionnel

This commit is contained in:
2017-02-09 21:53:24 +01:00
parent 38d236e09b
commit 2375dd6571
25 changed files with 279 additions and 470 deletions

View File

@ -1,3 +1,32 @@
import sys, os, argparse, tempfile
sys.path.append(os.path.dirname(__file__) + '/lib')
import tamarin, system, rkt
def get_args_parser():
parser = argparse.ArgumentParser(description="Tamarin's container entrypoint")
# Define available/required arguments and flags
parser.add_argument("profile", help="The selected profile to use for the build")
parser.add_argument("arch", help="The selected profile to use for the build")
return parser
def get_buildtools_dir():
return os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + "/buildtools")
if __name__ == '__main__':
print('Test')
parser = get_args_parser()
args = parser.parse_args()
profile = tamarin.load_profile(args.profile)
workspace = tempfile.mkdtemp(prefix="tamarin_")
env = os.environ.copy()
env['TAMARIN_TARGET_ARCH'] = args.arch
env['TAMARIN_WORKSPACE'] = workspace
env['PATH'] = env['PATH'] + ':' + get_buildtools_dir()
tamarin.run_profile_hooks(profile, 'prebuild', cwd=workspace, env=env)
tamarin.run_profile_hooks(profile, 'build', cwd=workspace, env=env)
tamarin.run_profile_hooks(profile, 'postbuild', cwd=workspace, env=env)