23 lines
636 B
Bash
23 lines
636 B
Bash
#!/bin/bash
|
|
set -x
|
|
export WM_BASE_URL="http://windmill_server:8000"
|
|
export WM_WORKSPACE="admins"
|
|
export PATH=$HOME/.npm-global/bin:$PATH
|
|
|
|
echo "=== START SYNC ==="
|
|
|
|
if ! command -v wmill &> /dev/null; then
|
|
npm install -g windmill-cli
|
|
fi
|
|
|
|
wmill sync pull --token "$WM_TOKEN" --base-url "$WM_BASE_URL" --workspace "$WM_WORKSPACE" --skip-variables --skip-secrets --skip-resources --yes --verbose || exit 1
|
|
|
|
git config --global --add safe.directory /workspace
|
|
git config --global user.email "bot@example.com"
|
|
git config --global user.name "Bot"
|
|
|
|
git add .
|
|
git commit -m "Auto-sync $(date)" || echo "No changes"
|
|
|
|
echo "=== END SYNC ==="
|