Update run.sh
Browse files
run.sh
CHANGED
@@ -1,31 +1,36 @@
|
|
1 |
#!/bin/bash
|
2 |
|
|
|
3 |
WEBDAV_URL="$WEBDAV_URL"
|
|
|
4 |
WEBDAV_USER="$WEBDAV_USER"
|
|
|
5 |
WEBDAV_PASSWORD="$WEBDAV_PASSWORD"
|
6 |
|
|
|
7 |
current_time=$(date +"%Y-%m-%d %H:%M:%S")
|
|
|
8 |
# LOG_FILE="${WORKDIR}/buildlog.txt"
|
9 |
|
10 |
-
#
|
11 |
/usr/local/bin/docker-entrypoint.sh postgres &
|
12 |
|
13 |
-
#
|
14 |
-
echo "
|
15 |
until pg_isready -h localhost; do
|
16 |
sleep 3
|
17 |
done
|
18 |
-
echo "PostgreSQL
|
19 |
|
20 |
-
#
|
21 |
-
echo "
|
22 |
${WORKDIR}/import-db.sh
|
23 |
|
24 |
-
#
|
25 |
export N8N_ENCRYPTION_KEY="n8n8n8n"
|
26 |
-
#
|
27 |
export NODE_FUNCTION_ALLOW_BUILTIN=*
|
28 |
-
#
|
29 |
export NODE_FUNCTION_ALLOW_EXTERNAL=*
|
30 |
# Activate automatic data pruning
|
31 |
export EXECUTIONS_DATA_PRUNE=true
|
@@ -42,15 +47,16 @@ export EXECUTIONS_DATA_SAVE_ON_PROGRESS=false
|
|
42 |
# Don't save manually launched executions
|
43 |
export EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=false
|
44 |
|
45 |
-
#
|
|
|
46 |
# if curl -u "$WEBDAV_USER:$WEBDAV_PASSWORD" -f -o "$LOG_FILE" "${WEBDAV_URL}buildlog.txt"; then
|
47 |
-
# echo "
|
48 |
-
# echo "hf
|
49 |
# else
|
50 |
-
# echo "WebDAV
|
51 |
# touch "${LOG_FILE}"
|
52 |
-
# echo "hf
|
53 |
# fi
|
54 |
|
55 |
-
#
|
56 |
-
n8n > /dev/null 2>&1
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
+
# WebDAV URL
|
4 |
WEBDAV_URL="$WEBDAV_URL"
|
5 |
+
# WebDAV username
|
6 |
WEBDAV_USER="$WEBDAV_USER"
|
7 |
+
# WebDAV password
|
8 |
WEBDAV_PASSWORD="$WEBDAV_PASSWORD"
|
9 |
|
10 |
+
# Get current time
|
11 |
current_time=$(date +"%Y-%m-%d %H:%M:%S")
|
12 |
+
# Log file path
|
13 |
# LOG_FILE="${WORKDIR}/buildlog.txt"
|
14 |
|
15 |
+
# Start PostgreSQL service
|
16 |
/usr/local/bin/docker-entrypoint.sh postgres &
|
17 |
|
18 |
+
# Wait for PostgreSQL service to start
|
19 |
+
echo "Waiting for PostgreSQL service to start..."
|
20 |
until pg_isready -h localhost; do
|
21 |
sleep 3
|
22 |
done
|
23 |
+
echo "PostgreSQL service started!"
|
24 |
|
25 |
+
# Run database import script
|
26 |
+
echo "Running database import script..."
|
27 |
${WORKDIR}/import-db.sh
|
28 |
|
29 |
+
# Set N8N environment variables
|
30 |
export N8N_ENCRYPTION_KEY="n8n8n8n"
|
31 |
+
# Allow use of all built-in modules
|
32 |
export NODE_FUNCTION_ALLOW_BUILTIN=*
|
33 |
+
# Allow use of external npm modules
|
34 |
export NODE_FUNCTION_ALLOW_EXTERNAL=*
|
35 |
# Activate automatic data pruning
|
36 |
export EXECUTIONS_DATA_PRUNE=true
|
|
|
47 |
# Don't save manually launched executions
|
48 |
export EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=false
|
49 |
|
50 |
+
# Check if log file exists on WebDAV
|
51 |
+
# echo "Checking if ${WEBDAV_URL}buildlog.txt exists"
|
52 |
# if curl -u "$WEBDAV_USER:$WEBDAV_PASSWORD" -f -o "$LOG_FILE" "${WEBDAV_URL}buildlog.txt"; then
|
53 |
+
# echo "Log file downloaded and written to deployment time: ${LOG_FILE}"
|
54 |
+
# echo "hf deployment time: ${current_time}" >> "${LOG_FILE}"
|
55 |
# else
|
56 |
+
# echo "WebDAV log file does not exist, creating new log file: ${LOG_FILE}"
|
57 |
# touch "${LOG_FILE}"
|
58 |
+
# echo "hf deployment time: ${current_time}" >> "${LOG_FILE}"
|
59 |
# fi
|
60 |
|
61 |
+
# Run n8n with absolute path
|
62 |
+
n8n > /dev/null 2>&1
|