tatasauce commited on
Commit
63e5c26
·
verified ·
1 Parent(s): 5f31b77

Create entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +28 -0
entrypoint.sh ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -e
3
+
4
+ CONFIG_FILE_PATH="/home/api.yaml"
5
+
6
+ echo "DEBUG: Entrypoint script started."
7
+
8
+ if [ -z "$API_YAML_CONTENT" ]; then
9
+ echo "ERROR: Secret 'API_YAML_CONTENT' does not exist or is empty. Exiting."
10
+ exit 1
11
+ else
12
+ echo "DEBUG: API_YAML_CONTENT secret found. Preparing to write..."
13
+ printf '%s\n' "$API_YAML_CONTENT" > "$CONFIG_FILE_PATH"
14
+ echo "DEBUG: Attempted to write to $CONFIG_FILE_PATH."
15
+
16
+ if [ -f "$CONFIG_FILE_PATH" ]; then
17
+ echo "DEBUG: File $CONFIG_FILE_PATH created successfully. Size: $(wc -c < "$CONFIG_FILE_PATH") bytes."
18
+ echo "DEBUG: First few lines (without sensitive info):"
19
+ head -n 3 "$CONFIG_FILE_PATH" | grep -v "api:" | grep -v "password"
20
+ else
21
+ echo "ERROR: File $CONFIG_FILE_PATH was NOT created."
22
+ exit 1
23
+ fi
24
+ fi
25
+
26
+ echo "DEBUG: About to execute python main.py..."
27
+ cd /home
28
+ exec python main.py "$@"