mirror of
https://github.com/Xe138/windmill-git-sync.git
synced 2026-04-05 02:47:24 -04:00
Compare commits
2 Commits
v0.1.0-alp
...
v0.1.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| ecc598788a | |||
| d380cee815 |
@@ -2,15 +2,16 @@ FROM python:3.11-slim
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies including Node.js
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
git \
|
git \
|
||||||
curl \
|
curl \
|
||||||
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||||
|
&& apt-get install -y nodejs \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install wmill CLI
|
# Install wmill CLI via npm
|
||||||
RUN curl -L https://github.com/windmill-labs/windmill/releases/latest/download/wmill-linux-amd64 -o /usr/local/bin/wmill \
|
RUN npm install -g windmill-cli
|
||||||
&& chmod +x /usr/local/bin/wmill
|
|
||||||
|
|
||||||
# Copy requirements and install Python dependencies
|
# Copy requirements and install Python dependencies
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|||||||
17
app/sync.py
17
app/sync.py
@@ -59,17 +59,18 @@ def run_wmill_sync(config: Dict[str, Any]) -> bool:
|
|||||||
|
|
||||||
logger.info(f"Syncing Windmill workspace '{workspace}' from {WINDMILL_BASE_URL}")
|
logger.info(f"Syncing Windmill workspace '{workspace}' from {WINDMILL_BASE_URL}")
|
||||||
|
|
||||||
env = os.environ.copy()
|
|
||||||
env['WM_BASE_URL'] = WINDMILL_BASE_URL
|
|
||||||
env['WM_TOKEN'] = windmill_token
|
|
||||||
env['WM_WORKSPACE'] = workspace
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Run wmill sync in the workspace directory
|
# Run wmill sync in the workspace directory with explicit flags
|
||||||
|
# Note: When using --base-url, --token and --workspace are required
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
['wmill', 'sync', 'pull', '--yes'],
|
[
|
||||||
|
'wmill', 'sync', 'pull',
|
||||||
|
'--base-url', WINDMILL_BASE_URL,
|
||||||
|
'--token', windmill_token,
|
||||||
|
'--workspace', workspace,
|
||||||
|
'--yes'
|
||||||
|
],
|
||||||
cwd=WORKSPACE_DIR,
|
cwd=WORKSPACE_DIR,
|
||||||
env=env,
|
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
check=True
|
check=True
|
||||||
|
|||||||
Reference in New Issue
Block a user