-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevopsfile.py
More file actions
82 lines (66 loc) · 2.39 KB
/
devopsfile.py
File metadata and controls
82 lines (66 loc) · 2.39 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#! /usr/bin/python3
import sys
import subprocess
class libdDevOpsRecipe():
# DevOps setup main data
name = "libd-devops"
version = "0.1.0"
git_tag = "xyz"
options = {
"devops-profile": [None,
"default-debug-config.json",
"default-release-config.json",
"gcc-131-debug-config.json",
"gcc-131-release-config.json"],
"os": [None, "Ubuntu", "Windows"],
"ide": [None, "qtcreator"]
}
default_options = {
"devops-profile": "default-debug-config.json",
"os": "Ubuntu",
"ide": "qtcreator"
}
# DevOps setup metadata
author = "Paul Heidenreich"
decription = "Settings configuration recipe file."
def configure(self):
self.options["devops-profile"] = ["gcc-131-debug-config.json"]
self.options["os"] = ["Ubuntu"]
self.options["ide"] = ["qtcreator"]
pass
# Check if the specified devops profile fits for this host operating system.
def checkProfile(self):
if self.options["devops-profile"]:
#return Settings.check(self.name, self.options["devops-profile"], self.os_list)
return False
else:
return True
#return Settings.check(self.name, self.default_options["devops-profile"], self.os_list)
pass
# Generate configurations for porject
def generate(self):
self.configure()
if len(self.options["devops-profile"]) > 1:
self.options["devops-profile"] = self.default_options["devops-profile"]
script = [
"./devops/command.py --bootstrap --name "+ self.name + " --profile " + self.options["devops-profile"][0]
]
print(script[0])
for cmd in script:
subprocess.run([cmd], shell = True, capture_output = False, text = False)
pass
def build(self):
print("This will be the build method call ...")
print("Calling conan create command will happen here ...")
###################################################################################################
dev = libdDevOpsRecipe()
def generate():
dev.generate()
def build():
dev.build()
# args[0] = current file
# args[1] = function name
# args[2:] = function args : (*unpacked)
if __name__ == "__main__":
args = sys.argv
globals()[args[1]](*args[2:])