大宅康喜 commited on
Commit
953318f
·
unverified ·
1 Parent(s): 3149f53

Create entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +21 -0
entrypoint.sh ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ cd /root/work
4
+
5
+ # Check for pyproject.toml
6
+ [ ! -f pyproject.toml ] && { echo "ERROR: pyproject.toml not found."; exit 1; }
7
+
8
+ # Check poetry.lock and its consistency
9
+ if [ -f poetry.lock ]; then
10
+ echo "Checking poetry.lock consistency..."
11
+ poetry lock --check || echo "WARNING: poetry.lock is out of date. Run 'poetry lock' to update."
12
+
13
+ # Compare dependencies
14
+ lock_deps=$(poetry export --format requirements.txt --without-hashes | sort)
15
+ pyproject_deps=$(poetry export --format requirements.txt --without-hashes --without-urls | sort)
16
+ [ "$lock_deps" != "$pyproject_deps" ] && echo "WARNING: Dependencies mismatch. Run 'poetry lock' to update."
17
+ else
18
+ echo "WARNING: poetry.lock not found. Run 'poetry lock' to create it."
19
+ fi
20
+
21
+ exec "$@"