portmgr 1.7.0.dev1__tar.gz → 1.8.0.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/PKG-INFO +9 -12
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/__init__.py +1 -1
- portmgr-1.8.0.dev0/portmgr/commands/push.py +76 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/wrapper.py +3 -3
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr.egg-info/PKG-INFO +9 -12
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr.egg-info/SOURCES.txt +1 -0
- portmgr-1.8.0.dev0/portmgr.egg-info/requires.txt +4 -0
- portmgr-1.8.0.dev0/pyproject.toml +18 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/setup.py +1 -1
- portmgr-1.7.0.dev1/portmgr/commands/push.py +0 -69
- portmgr-1.7.0.dev1/portmgr.egg-info/requires.txt +0 -5
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/LICENSE +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/README.md +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/__main__.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/__init__.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/attach.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/build.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/down.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/logs.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/ps.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/pull.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/scan.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/stats.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/stop.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/top.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/commands/up.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr/portmgr.py +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr.egg-info/dependency_links.txt +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr.egg-info/entry_points.txt +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr.egg-info/not-zip-safe +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/portmgr.egg-info/top_level.txt +0 -0
- {portmgr-1.7.0.dev1 → portmgr-1.8.0.dev0}/setup.cfg +0 -0
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: portmgr
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0.dev0
|
|
4
4
|
Summary: Simple command interface to manage multiple Docker container
|
|
5
5
|
Home-page: https://github.com/Craeckie/portmgr
|
|
6
|
-
License:
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Website, https://github.com/Craeckie/portmgr
|
|
8
|
+
Project-URL: Repository, https://github.com/Craeckie/portmgr.git
|
|
9
|
+
Requires-Python: >=3.12
|
|
7
10
|
Description-Content-Type: text/markdown
|
|
8
11
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist:
|
|
10
|
-
Requires-Dist:
|
|
11
|
-
Requires-Dist:
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Requires-Dist: humanfriendly
|
|
14
|
-
Dynamic: description
|
|
15
|
-
Dynamic: description-content-type
|
|
12
|
+
Requires-Dist: humanfriendly~=10.0
|
|
13
|
+
Requires-Dist: jsonschema~=3.2.0
|
|
14
|
+
Requires-Dist: pyyaml~=6.0.2
|
|
15
|
+
Requires-Dist: tabulate~=0.8.9
|
|
16
16
|
Dynamic: home-page
|
|
17
|
-
Dynamic: license
|
|
18
17
|
Dynamic: license-file
|
|
19
|
-
Dynamic: requires-dist
|
|
20
|
-
Dynamic: summary
|
|
21
18
|
|
|
22
19
|
# portmgr
|
|
23
20
|
portmgr is a wrapper around [docker-compose](https://docs.docker.com/compose/) that allows running typical docker-compose commands recursively. Additionally, it shortens commands to a single letter.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
from .portmgr import main, command_list, bcolors
|
|
2
|
-
from .wrapper import runCompose
|
|
2
|
+
from .wrapper import runCompose, runBuildx
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
from portmgr import command_list, bcolors, runCompose, runBuildx
|
|
2
|
+
import subprocess
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
from portmgr.wrapper import getServices
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def func(action):
|
|
9
|
+
directory = action['directory']
|
|
10
|
+
relative = action['relative']
|
|
11
|
+
|
|
12
|
+
services = getServices(includeOnlyBuildable=True)
|
|
13
|
+
|
|
14
|
+
print('Services to build: ' + ', '.join(services))
|
|
15
|
+
|
|
16
|
+
res = 0
|
|
17
|
+
for service in services.keys():
|
|
18
|
+
print(f"\nBuilding {service}")
|
|
19
|
+
|
|
20
|
+
new_res = 2
|
|
21
|
+
if multi_platform := os.environ.get("PORTMGR_MULTI_PLATFORM", "").lower():
|
|
22
|
+
try:
|
|
23
|
+
new_res = runBuildx(
|
|
24
|
+
['bake',
|
|
25
|
+
'--pull',
|
|
26
|
+
'--push',
|
|
27
|
+
'--set', f'*.platform={multi_platform}',
|
|
28
|
+
service
|
|
29
|
+
], timeout=1200 #kill after 20mins
|
|
30
|
+
)
|
|
31
|
+
if new_res != 0:
|
|
32
|
+
res = new_res
|
|
33
|
+
print(f"Error building {service}!")
|
|
34
|
+
except TimeoutExpired:
|
|
35
|
+
print(f"Error building {service}! Build timed out.")
|
|
36
|
+
else:
|
|
37
|
+
try:
|
|
38
|
+
new_res = runCompose(
|
|
39
|
+
['build',
|
|
40
|
+
'--pull',
|
|
41
|
+
'--force-rm',
|
|
42
|
+
'--compress',
|
|
43
|
+
service
|
|
44
|
+
], timeout=1200
|
|
45
|
+
)
|
|
46
|
+
if new_res != 0:
|
|
47
|
+
res = new_res
|
|
48
|
+
print(f"Error building {service}!")
|
|
49
|
+
else:
|
|
50
|
+
new_res = runCompose(
|
|
51
|
+
['push',
|
|
52
|
+
'--ignore-push-failures',
|
|
53
|
+
service
|
|
54
|
+
]
|
|
55
|
+
)
|
|
56
|
+
print(f"Error pushing {service}!")
|
|
57
|
+
except TimeoutExpired:
|
|
58
|
+
print(f"Error building {service}! Build timed out.")
|
|
59
|
+
if new_res != 1:
|
|
60
|
+
res = new_res
|
|
61
|
+
if os.environ.get("PORTMGR_CLEAN_AFTER_PUSH", "").lower() == "true":
|
|
62
|
+
subprocess.call(['docker', 'system', 'prune', '--all', '--force'])
|
|
63
|
+
subprocess.call(['docker', 'buildx', 'prune', '--all', '--force'])
|
|
64
|
+
|
|
65
|
+
if res != 0:
|
|
66
|
+
print("Error building&pushing " + relative + "!")
|
|
67
|
+
return res
|
|
68
|
+
|
|
69
|
+
return res
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
command_list['r'] = {
|
|
73
|
+
'hlp': 'build, push to registry & remove image',
|
|
74
|
+
'ord': 'nrm',
|
|
75
|
+
'fnc': func
|
|
76
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import os
|
|
3
|
-
from subprocess import
|
|
3
|
+
from subprocess import run, check_output
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def getServices(includeOnlyBuildable=False):
|
|
@@ -59,9 +59,9 @@ def runCompose(args, **kwargs):
|
|
|
59
59
|
if os.environ.get("PORTMGR_IN_SCRIPT", "").lower() == "true":
|
|
60
60
|
command += ["--ansi", "never"]
|
|
61
61
|
command += list(args)
|
|
62
|
-
return
|
|
62
|
+
return run(command, **kwargs).returncode
|
|
63
63
|
|
|
64
64
|
def runBuildx(args, **kwargs):
|
|
65
65
|
command = ['docker', 'buildx']
|
|
66
66
|
command += list(args)
|
|
67
|
-
return
|
|
67
|
+
return run(command, **kwargs).returncode
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: portmgr
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0.dev0
|
|
4
4
|
Summary: Simple command interface to manage multiple Docker container
|
|
5
5
|
Home-page: https://github.com/Craeckie/portmgr
|
|
6
|
-
License:
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Website, https://github.com/Craeckie/portmgr
|
|
8
|
+
Project-URL: Repository, https://github.com/Craeckie/portmgr.git
|
|
9
|
+
Requires-Python: >=3.12
|
|
7
10
|
Description-Content-Type: text/markdown
|
|
8
11
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist:
|
|
10
|
-
Requires-Dist:
|
|
11
|
-
Requires-Dist:
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Requires-Dist: humanfriendly
|
|
14
|
-
Dynamic: description
|
|
15
|
-
Dynamic: description-content-type
|
|
12
|
+
Requires-Dist: humanfriendly~=10.0
|
|
13
|
+
Requires-Dist: jsonschema~=3.2.0
|
|
14
|
+
Requires-Dist: pyyaml~=6.0.2
|
|
15
|
+
Requires-Dist: tabulate~=0.8.9
|
|
16
16
|
Dynamic: home-page
|
|
17
|
-
Dynamic: license
|
|
18
17
|
Dynamic: license-file
|
|
19
|
-
Dynamic: requires-dist
|
|
20
|
-
Dynamic: summary
|
|
21
18
|
|
|
22
19
|
# portmgr
|
|
23
20
|
portmgr is a wrapper around [docker-compose](https://docs.docker.com/compose/) that allows running typical docker-compose commands recursively. Additionally, it shortens commands to a single letter.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "portmgr"
|
|
3
|
+
version = "1.8.0dev0"
|
|
4
|
+
description = "Simple command interface to manage multiple Docker container"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
requires-python = ">=3.12"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"humanfriendly~=10.0",
|
|
10
|
+
"jsonschema~=3.2.0",
|
|
11
|
+
"pyyaml~=6.0.2",
|
|
12
|
+
"tabulate~=0.8.9",
|
|
13
|
+
]
|
|
14
|
+
[project.urls]
|
|
15
|
+
Website = "https://github.com/Craeckie/portmgr"
|
|
16
|
+
Repository = "https://github.com/Craeckie/portmgr.git"
|
|
17
|
+
[project.scripts]
|
|
18
|
+
portmgr = "portmgr:main"
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='portmgr',
|
|
5
|
-
version='1.
|
|
5
|
+
version='1.8.0dev0',
|
|
6
6
|
url="https://github.com/Craeckie/portmgr",
|
|
7
7
|
description="Simple command interface to manage multiple Docker container",
|
|
8
8
|
packages=find_packages(), #['portmgr'],
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
from portmgr import command_list, bcolors, runCompose
|
|
2
|
-
import subprocess
|
|
3
|
-
import os
|
|
4
|
-
|
|
5
|
-
from portmgr.wrapper import getServices
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def func(action):
|
|
9
|
-
directory = action['directory']
|
|
10
|
-
relative = action['relative']
|
|
11
|
-
|
|
12
|
-
services = getServices(includeOnlyBuildable=True)
|
|
13
|
-
|
|
14
|
-
print('Services to build: ' + ', '.join(services))
|
|
15
|
-
|
|
16
|
-
res = 0
|
|
17
|
-
for service in services.keys():
|
|
18
|
-
print(f"\nBuilding {service}")
|
|
19
|
-
|
|
20
|
-
if os.environ.get("PORTMGR_MULTI_PLATFORM", "").lower():
|
|
21
|
-
new_res = runBuildx(
|
|
22
|
-
['bake',
|
|
23
|
-
'--pull',
|
|
24
|
-
'--push',
|
|
25
|
-
'--set', f'*.platform={PORTMGR_MULTI_PLATFORM}',
|
|
26
|
-
service
|
|
27
|
-
]
|
|
28
|
-
)
|
|
29
|
-
if new_res != 0:
|
|
30
|
-
res = new_res
|
|
31
|
-
print(f"Error building {service}!")
|
|
32
|
-
else:
|
|
33
|
-
new_res = runCompose(
|
|
34
|
-
['build',
|
|
35
|
-
'--pull',
|
|
36
|
-
'--force-rm',
|
|
37
|
-
'--compress',
|
|
38
|
-
service
|
|
39
|
-
]
|
|
40
|
-
)
|
|
41
|
-
if new_res != 0:
|
|
42
|
-
res = new_res
|
|
43
|
-
print(f"Error building {service}!")
|
|
44
|
-
else:
|
|
45
|
-
new_res = runCompose(
|
|
46
|
-
['push',
|
|
47
|
-
'--ignore-push-failures',
|
|
48
|
-
service
|
|
49
|
-
]
|
|
50
|
-
)
|
|
51
|
-
if new_res != 0:
|
|
52
|
-
res = new_res
|
|
53
|
-
print(f"Error pushing {service}!")
|
|
54
|
-
if os.environ.get("PORTMGR_CLEAN_AFTER_PUSH", "").lower() == "true":
|
|
55
|
-
subprocess.call(['docker', 'system', 'prune', '--all', '--force'])
|
|
56
|
-
subprocess.call(['docker', 'buildx', 'prune', '--all', '--force'])
|
|
57
|
-
|
|
58
|
-
if res != 0:
|
|
59
|
-
print("Error building&pushing " + relative + "!")
|
|
60
|
-
return res
|
|
61
|
-
|
|
62
|
-
return res
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
command_list['r'] = {
|
|
66
|
-
'hlp': 'build, push to registry & remove image',
|
|
67
|
-
'ord': 'nrm',
|
|
68
|
-
'fnc': func
|
|
69
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|