-
Notifications
You must be signed in to change notification settings - Fork 2
/
crops_generator.py
executable file
·49 lines (39 loc) · 1.15 KB
/
crops_generator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python3
# generate-crops.py
#
# Copyright (C) 2023 Baylibre
#
# SPDX-License-Identifier: GPL-2.0-only
#
import sys
import os
import shutil
import subprocess
import argparse
from pathlib import Path
bindir = os.path.dirname(__file__)
topdir = os.path.dirname(bindir)
sys.path[0:0] = [os.path.join(topdir, 'lib')]
if __name__ == "__main__":
from crops import crops
parser = argparse.ArgumentParser(
prog='crops_generator.py',
description='A generator tool from CROPS')
parser.add_argument("--kconf", \
help="Name of .config to transform into CROPS Dockerfile", \
default=".config", \
type=str, required=True)
parser.add_argument("--docker", help="Docker Container Context", type=str, required=True)
args = parser.parse_args()
crps=crops(args.kconf, args.docker, topdir)
crps.MakeDockerDir()
crps.SetUseradd()
crps.SetHostOS()
crps.UnpackTC()
crps.SetTC()
crps.SetEnvs()
crps.SetPackages()
crps.SetEntrypoints()
crps.SetRepo()
crps.SetTemplate()
crps.WriteDockerFile()