vm-tool 1.0.37__tar.gz → 1.0.39__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.
- {vm_tool-1.0.37 → vm_tool-1.0.39}/PKG-INFO +1 -1
- {vm_tool-1.0.37 → vm_tool-1.0.39}/codePushToGithub.py +43 -48
- {vm_tool-1.0.37 → vm_tool-1.0.39}/pyproject.toml +2 -2
- {vm_tool-1.0.37 → vm_tool-1.0.39}/setup.py +1 -1
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/cli.py +8 -1
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/runner.py +2 -1
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/push_code_tasks.yml +7 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool.egg-info/PKG-INFO +1 -1
- {vm_tool-1.0.37 → vm_tool-1.0.39}/.devcontainer/devcontainer.json +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/.github/dependabot.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/.github/workflows/ci.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/.github/workflows/deploy.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/.github/workflows/publish.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/.gitignore +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/.pre-commit-config.yaml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/CONTRIBUTING +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/CONTRIBUTING.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/LICENSE +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/MANIFEST.in +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/Makefile +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/README.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/MODULE_GUIDE.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/deployment-approaches.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/ec2-github-actions-guide.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/features.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/generator.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/index.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/pipeline-generator.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/reference/runner.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/reference/ssh.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/ssh-key-setup.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/docs/usage.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/README.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/__init__.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/cloud/README.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/cloud/__init__.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/cloud/ssh_identity_file.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/cloud/ssh_password.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/cloud/template_cloud_setup.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/deploy_full_setup.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/docker-compose.example.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/ec2-setup.sh +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/github-actions-ec2.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/github-actions-full-setup.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/local/.keep +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/local/README.md +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/local/__init__.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/local/template_local_setup.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/production-deploy.sh +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/rollback.sh +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/setup.sh +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/ssh_key_management.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/examples/version_check.sh +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/mkdocs.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/molecule/default/converge.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/molecule/default/molecule.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/molecule/default/verify.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/requirements-docs.txt +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/requirements.txt +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/runtime.txt +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/setup.cfg +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/tests/conftest.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/tests/integration/test_deployment.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/tests/test_config.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/tests/test_generator.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/tests/test_health.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/tests/test_history.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/tests/test_logging.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/tests/test_runner.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/tests/test_ssh.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/tests/test_state.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/__init__.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/alerting.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/audit.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/backup.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/benchmarking.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/cloud.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/completion.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/compliance.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/config.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/drift.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/generator.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/health.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/history.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/kubernetes.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/metrics.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/notifications.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/plugins.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/policy.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/rbac.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/recovery.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/reporting.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/secrets.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/ssh.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/state.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/strategies/__init__.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/strategies/ab_testing.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/strategies/blue_green.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/strategies/canary.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/validation.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/cleanup.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/docker/create_docker_service.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/docker/docker_setup.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/docker/install_docker_and_compose.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/docker/login_to_docker_hub.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/github/git_configuration.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/inventory.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/k8s.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/main.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/monitoring.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/project_service.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/push_code.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/setup.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/vm_setup/setup_project_env.yml +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool/webhooks.py +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool.egg-info/SOURCES.txt +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool.egg-info/dependency_links.txt +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool.egg-info/entry_points.txt +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool.egg-info/requires.txt +0 -0
- {vm_tool-1.0.37 → vm_tool-1.0.39}/vm_tool.egg-info/top_level.txt +0 -0
|
@@ -13,11 +13,7 @@ def run_command(cmd, check=True, shell=True):
|
|
|
13
13
|
"""Run a shell command and return the result."""
|
|
14
14
|
try:
|
|
15
15
|
result = subprocess.run(
|
|
16
|
-
cmd,
|
|
17
|
-
shell=shell,
|
|
18
|
-
check=check,
|
|
19
|
-
capture_output=True,
|
|
20
|
-
text=True
|
|
16
|
+
cmd, shell=shell, check=check, capture_output=True, text=True
|
|
21
17
|
)
|
|
22
18
|
if result.stdout:
|
|
23
19
|
print(result.stdout)
|
|
@@ -37,7 +33,7 @@ def get_venv_path():
|
|
|
37
33
|
def get_python_executable():
|
|
38
34
|
"""Get the Python executable path for the virtual environment."""
|
|
39
35
|
venv_path = get_venv_path()
|
|
40
|
-
if os.name ==
|
|
36
|
+
if os.name == "nt": # Windows
|
|
41
37
|
return venv_path / "Scripts" / "python.exe"
|
|
42
38
|
else: # Unix/Linux/Mac
|
|
43
39
|
return venv_path / "bin" / "python"
|
|
@@ -46,7 +42,7 @@ def get_python_executable():
|
|
|
46
42
|
def get_pip_executable():
|
|
47
43
|
"""Get the pip executable path for the virtual environment."""
|
|
48
44
|
venv_path = get_venv_path()
|
|
49
|
-
if os.name ==
|
|
45
|
+
if os.name == "nt": # Windows
|
|
50
46
|
return venv_path / "Scripts" / "pip.exe"
|
|
51
47
|
else: # Unix/Linux/Mac
|
|
52
48
|
return venv_path / "bin" / "pip"
|
|
@@ -55,7 +51,7 @@ def get_pip_executable():
|
|
|
55
51
|
def create_venv():
|
|
56
52
|
"""Create a virtual environment if it doesn't exist."""
|
|
57
53
|
venv_path = get_venv_path()
|
|
58
|
-
|
|
54
|
+
|
|
59
55
|
if not venv_path.exists():
|
|
60
56
|
print("📦 Creating virtual environment...")
|
|
61
57
|
run_command(f'"{sys.executable}" -m venv venv')
|
|
@@ -67,23 +63,23 @@ def create_venv():
|
|
|
67
63
|
def install_dependencies():
|
|
68
64
|
"""Install required dependencies in the virtual environment."""
|
|
69
65
|
python_exe = get_python_executable()
|
|
70
|
-
|
|
66
|
+
|
|
71
67
|
print("📦 Installing/updating dependencies...")
|
|
72
68
|
# Use python -m pip instead of direct pip executable (Windows compatibility)
|
|
73
69
|
run_command(f'"{python_exe}" -m pip install --upgrade pip')
|
|
74
70
|
run_command(f'"{python_exe}" -m pip install bump-my-version')
|
|
75
|
-
|
|
71
|
+
|
|
76
72
|
# Install project dependencies if requirements.txt exists
|
|
77
73
|
if Path("requirements.txt").exists():
|
|
78
74
|
run_command(f'"{python_exe}" -m pip install -r requirements.txt')
|
|
79
|
-
|
|
75
|
+
|
|
80
76
|
print("✅ Dependencies installed!")
|
|
81
77
|
|
|
82
78
|
|
|
83
79
|
def setup_environment():
|
|
84
80
|
"""Setup virtual environment and dependencies."""
|
|
85
81
|
venv_created = create_venv()
|
|
86
|
-
|
|
82
|
+
|
|
87
83
|
# Always install/update dependencies if venv was just created
|
|
88
84
|
if venv_created:
|
|
89
85
|
install_dependencies()
|
|
@@ -99,21 +95,21 @@ def setup_environment():
|
|
|
99
95
|
def run_in_venv(cmd):
|
|
100
96
|
"""Run a command using the virtual environment's Python."""
|
|
101
97
|
python_exe = get_python_executable()
|
|
102
|
-
|
|
98
|
+
|
|
103
99
|
# For bump-my-version, we need to use the venv's Scripts directory
|
|
104
100
|
venv_path = get_venv_path()
|
|
105
|
-
if os.name ==
|
|
101
|
+
if os.name == "nt":
|
|
106
102
|
bump_exe = venv_path / "Scripts" / "bump-my-version.exe"
|
|
107
103
|
else:
|
|
108
104
|
bump_exe = venv_path / "bin" / "bump-my-version"
|
|
109
|
-
|
|
105
|
+
|
|
110
106
|
# Replace bump-my-version command with full path
|
|
111
107
|
if cmd.startswith("bump-my-version"):
|
|
112
108
|
cmd = cmd.replace("bump-my-version", f'"{bump_exe}"')
|
|
113
109
|
# Add verbose flag to show what's happening
|
|
114
110
|
if "--verbose" not in cmd and "-v" not in cmd:
|
|
115
111
|
cmd = cmd.replace("bump patch", "bump patch --verbose")
|
|
116
|
-
|
|
112
|
+
|
|
117
113
|
return run_command(cmd)
|
|
118
114
|
|
|
119
115
|
|
|
@@ -136,71 +132,70 @@ def main():
|
|
|
136
132
|
print("🔧 Setting up environment...")
|
|
137
133
|
setup_environment()
|
|
138
134
|
print()
|
|
139
|
-
|
|
135
|
+
|
|
140
136
|
# Ask for the branch name
|
|
141
137
|
branch_name = input("Enter the branch name: ").strip()
|
|
142
|
-
|
|
138
|
+
|
|
143
139
|
if branch_name == "main":
|
|
144
|
-
#
|
|
140
|
+
# 1. Commit User Changes FIRST
|
|
141
|
+
print("Adding changes...")
|
|
142
|
+
run_command("git add .")
|
|
143
|
+
|
|
144
|
+
commit_message = input("Enter the commit message for your changes: ").strip()
|
|
145
|
+
print("Committing changes...")
|
|
146
|
+
run_command(f'git commit -m "{commit_message}"')
|
|
147
|
+
|
|
148
|
+
# 2. Bump Version (which creates a new commit and tag)
|
|
145
149
|
current_version = get_current_version()
|
|
146
|
-
|
|
147
|
-
# Bump version for main branch
|
|
148
|
-
print("\n" + "="*60)
|
|
150
|
+
print("\n" + "=" * 60)
|
|
149
151
|
print(f"🔢 Bumping version from {current_version}...")
|
|
150
|
-
print("="*60)
|
|
152
|
+
print("=" * 60)
|
|
151
153
|
run_in_venv("bump-my-version bump patch --allow-dirty")
|
|
152
|
-
|
|
154
|
+
|
|
153
155
|
# Get new version after bump
|
|
154
156
|
new_version = get_current_version()
|
|
155
|
-
print("\n" + "="*60)
|
|
157
|
+
print("\n" + "=" * 60)
|
|
156
158
|
print(f"✅ Version bumped: {current_version} → {new_version}")
|
|
157
|
-
print("="*60 + "\n")
|
|
158
|
-
|
|
159
|
-
#
|
|
160
|
-
print("Adding changes...")
|
|
161
|
-
run_command("git add .")
|
|
162
|
-
|
|
163
|
-
# Ask for commit message
|
|
164
|
-
commit_message = input("Enter the commit message: ").strip()
|
|
165
|
-
|
|
166
|
-
# Commit with the entered message
|
|
167
|
-
print("Committing changes...")
|
|
168
|
-
run_command(f'git commit -m "{commit_message}"')
|
|
169
|
-
|
|
170
|
-
# Push changes directly to the "main" branch
|
|
159
|
+
print("=" * 60 + "\n")
|
|
160
|
+
|
|
161
|
+
# 3. Push everything
|
|
171
162
|
print("Pushing to main...")
|
|
172
163
|
run_command("git push origin main")
|
|
173
|
-
|
|
164
|
+
|
|
165
|
+
# Push tags to trigger PyPI publish
|
|
166
|
+
print("Pushing tags...")
|
|
167
|
+
run_command("git push origin --tags")
|
|
168
|
+
|
|
174
169
|
# Pull latest changes
|
|
175
170
|
print("Pulling latest changes...")
|
|
176
171
|
run_command("git pull origin main")
|
|
177
|
-
|
|
172
|
+
|
|
178
173
|
print("✅ Successfully pushed to main with version bump!")
|
|
179
|
-
|
|
174
|
+
|
|
180
175
|
else:
|
|
181
176
|
# Create and switch to the new branch
|
|
182
177
|
print(f"Creating and switching to branch: {branch_name}")
|
|
183
178
|
run_command(f"git checkout -b {branch_name}")
|
|
184
|
-
|
|
179
|
+
|
|
185
180
|
# Add all changes
|
|
186
181
|
print("Adding changes...")
|
|
187
182
|
run_command("git add .")
|
|
188
|
-
|
|
183
|
+
|
|
189
184
|
# Ask for commit message
|
|
190
185
|
commit_message = input("Enter the commit message: ").strip()
|
|
191
|
-
|
|
186
|
+
|
|
192
187
|
# Commit with the entered message
|
|
193
188
|
print("Committing changes...")
|
|
194
189
|
run_command(f'git commit -m "{commit_message}"')
|
|
195
|
-
|
|
190
|
+
|
|
196
191
|
# Push changes to the specified branch
|
|
197
192
|
print(f"Pushing to {branch_name}...")
|
|
198
193
|
run_command(f"git push origin {branch_name}")
|
|
199
|
-
|
|
194
|
+
|
|
200
195
|
# Switch back to main
|
|
201
196
|
print("Switching back to main...")
|
|
202
197
|
run_command("git checkout main")
|
|
203
|
-
|
|
198
|
+
|
|
204
199
|
print(f"✅ Successfully pushed to {branch_name}!")
|
|
205
200
|
|
|
206
201
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "vm_tool"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.39"
|
|
8
8
|
description = "A Comprehensive Tool for Setting Up Virtual Machines."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -76,7 +76,7 @@ include = '\.pyi?$'
|
|
|
76
76
|
profile = "black"
|
|
77
77
|
multi_line_output = 3
|
|
78
78
|
[tool.bumpversion]
|
|
79
|
-
current_version = "1.0.
|
|
79
|
+
current_version = "1.0.39"
|
|
80
80
|
commit = true
|
|
81
81
|
tag = true
|
|
82
82
|
|
|
@@ -12,7 +12,7 @@ else:
|
|
|
12
12
|
|
|
13
13
|
setup(
|
|
14
14
|
name="vm_tool",
|
|
15
|
-
version="1.0.
|
|
15
|
+
version="1.0.39", # This will be updated by bump2version
|
|
16
16
|
packages=find_packages(),
|
|
17
17
|
description="A Comprehensive Tool for Setting Up Virtual Machines.",
|
|
18
18
|
long_description=long_description,
|
|
@@ -6,7 +6,7 @@ def main():
|
|
|
6
6
|
parser = argparse.ArgumentParser(
|
|
7
7
|
description="VM Tool: Setup, Provision, and Manage VMs"
|
|
8
8
|
)
|
|
9
|
-
parser.add_argument("--version", action="version", version="1.0.
|
|
9
|
+
parser.add_argument("--version", action="version", version="1.0.39")
|
|
10
10
|
parser.add_argument(
|
|
11
11
|
"--verbose", "-v", action="store_true", help="Enable verbose output"
|
|
12
12
|
)
|
|
@@ -236,6 +236,12 @@ def main():
|
|
|
236
236
|
action="store_true",
|
|
237
237
|
help="Preview deployment without executing (shows what would be deployed)",
|
|
238
238
|
)
|
|
239
|
+
docker_parser.add_argument(
|
|
240
|
+
"--project-dir",
|
|
241
|
+
type=str,
|
|
242
|
+
default="~/app",
|
|
243
|
+
help="Target directory on the server for deployment (default: ~/app)",
|
|
244
|
+
)
|
|
239
245
|
|
|
240
246
|
# Completion command
|
|
241
247
|
completion_parser = subparsers.add_parser(
|
|
@@ -600,6 +606,7 @@ def main():
|
|
|
600
606
|
env_file=args.env_file,
|
|
601
607
|
deploy_command=args.deploy_command,
|
|
602
608
|
force=args.force,
|
|
609
|
+
project_dir=args.project_dir,
|
|
603
610
|
)
|
|
604
611
|
|
|
605
612
|
# Run health checks if specified
|
|
@@ -320,6 +320,7 @@ class SetupRunner:
|
|
|
320
320
|
env_file: str = None,
|
|
321
321
|
deploy_command: str = None,
|
|
322
322
|
force: bool = False,
|
|
323
|
+
project_dir: str = "~/app",
|
|
323
324
|
):
|
|
324
325
|
"""Runs the Docker Compose deployment with idempotency."""
|
|
325
326
|
from vm_tool.state import DeploymentState
|
|
@@ -391,7 +392,7 @@ class SetupRunner:
|
|
|
391
392
|
"GITHUB_PROJECT_URL": self.github_project_url,
|
|
392
393
|
"DEPLOY_MODE": "push",
|
|
393
394
|
"SOURCE_PATH": os.getcwd(), # Current working directory where vm_tool is run
|
|
394
|
-
"project_dest_dir":
|
|
395
|
+
"project_dest_dir": project_dir,
|
|
395
396
|
"GITHUB_REPOSITORY_OWNER": os.environ.get("GITHUB_REPOSITORY_OWNER", ""),
|
|
396
397
|
}
|
|
397
398
|
|
|
@@ -19,6 +19,13 @@
|
|
|
19
19
|
# Let's rely on 'synchronize' (rsync) if available, or just copy the compose file if user only provided that.
|
|
20
20
|
|
|
21
21
|
# For MVP of 'deploy-docker', let's copy the DOCKER_COMPOSE_FILE_PATH and .env if exists.
|
|
22
|
+
- name: Ensure Docker Compose file parent directory exists
|
|
23
|
+
file:
|
|
24
|
+
path: "{{ project_dest_dir }}/{{ DOCKER_COMPOSE_FILE_PATH | dirname }}"
|
|
25
|
+
state: directory
|
|
26
|
+
mode: '0755'
|
|
27
|
+
when: DOCKER_COMPOSE_FILE_PATH is defined and (DOCKER_COMPOSE_FILE_PATH | dirname) != ''
|
|
28
|
+
|
|
22
29
|
- name: Copy Docker Compose file
|
|
23
30
|
copy:
|
|
24
31
|
src: "{{ SOURCE_PATH }}/{{ DOCKER_COMPOSE_FILE_PATH }}"
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|