POC fonctionnel
This commit is contained in:
31
lib/build.py
31
lib/build.py
@ -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)
|
||||
|
Reference in New Issue
Block a user