-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.py
More file actions
35 lines (27 loc) · 1.92 KB
/
script.py
File metadata and controls
35 lines (27 loc) · 1.92 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
import dockerfile
import requests
dockerfile_url = {}
dockerfile_url["KheopsAuthorization"] = "https://raw.githubusercontent.com/OsiriX-Foundation/KheopsAuthorization/dev_env_var/docker/Dockerfile"
dockerfile_url["KheopsNginx"] = "https://raw.githubusercontent.com/OsiriX-Foundation/KheopsNginx/master/Dockerfile"
dockerfile_url["KheopsUI"] = "https://raw.githubusercontent.com/OsiriX-Foundation/KheopsUI/master/Dockerfile"
dockerfile_url["KheopsDICOMwebProxy"] = "https://raw.githubusercontent.com/OsiriX-Foundation/KheopsDICOMwebProxy/master/docker/Dockerfile"
dockerfile_url["KheopsZipper"] = "https://raw.githubusercontent.com/OsiriX-Foundation/KheopsZipper/master/docker/Dockerfile"
dockerfile_url["PACS_PEP"] = "https://raw.githubusercontent.com/OsiriX-Foundation/PACSProxyAuthorization/master/hosts/proxy/Dockerfile"
file='README.md'
with open(file, 'w') as filetowrite:
for repo in dockerfile_url:
response = requests.get(dockerfile_url[repo])
print(repo)
filetowrite.write("## "+repo+"\n\n")
for command in dockerfile.parse_string(response.content.decode("utf-8")):
if command.cmd == 'env':
for i in range(0, len(command.value), 2):
if not str(command.value[i+1]):
print(str(command.value[i]) + " this env var is mandatory")
filetowrite.write("`" + str(command.value[i]) + "` this env var is mandatory"+"<br>\n")
elif str(command.value[i+1]) == "\"\"":
print(str(command.value[i]) + " this env var is optional")
filetowrite.write("`" + str(command.value[i]) + "` this env var is optional"+"<br>\n")
else:
print(str(command.value[i]) + " value : " + str(command.value[i+1]))
filetowrite.write("`" + str(command.value[i]) + "` default value : " + str(command.value[i+1])+"<br>\n")