Skip to content

Commit 418b29a

Browse files
Modify LiteFS config for PR preview to use static lease type
Co-authored-by: me <[email protected]>
1 parent 2957983 commit 418b29a

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

.github/workflows/pr-preview.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,15 @@ jobs:
5858
# Copy and modify litefs.yml for PR preview (standalone, no consul)
5959
cp other/litefs.yml other/litefs.yml.backup
6060
61-
# Remove the entire lease section to make it standalone
62-
# This removes everything from "lease:" to the next top-level section
63-
awk '
64-
/^lease:/ { in_lease = 1; next }
65-
/^[a-zA-Z]/ && in_lease && !/^ / { in_lease = 0 }
66-
!in_lease { print }
67-
' other/litefs.yml > other/litefs.yml.tmp && mv other/litefs.yml.tmp other/litefs.yml
61+
# Replace consul lease with static lease for PR preview isolation
62+
# This makes each PR preview a standalone instance
63+
sed -i '/^lease:/,/^$/c\
64+
lease:\
65+
type: '\''static'\''
66+
' other/litefs.yml
6867
6968
# Add a comment explaining the isolation
70-
sed -i '/^exit-on-error:/a\\n# PR Preview: No lease configuration - standalone instance\n# This prevents syncing with production data' other/litefs.yml
69+
sed -i '/^lease:/i\\n# PR Preview: Using static lease type for standalone instance\n# This prevents syncing with production data' other/litefs.yml
7170

7271
echo "=== Modified fly.toml ==="
7372
cat fly.toml

0 commit comments

Comments
 (0)