File size: 1,958 Bytes
bb217b1
 
cc9ee69
8613173
cc9ee69
8613173
cc9ee69
8613173
 
cc9ee69
148af65
cc9ee69
f991908
148af65
cc9ee69
bb217b1
 
cc9ee69
 
bb217b1
 
 
cc9ee69
bb217b1
cc9ee69
 
34f01fa
bb217b1
cc9ee69
bb217b1
cc9ee69
bb217b1
cc9ee69
bb217b1
148af65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cc9ee69
 
43dd50a
cc9ee69
 
43dd50a
cc9ee69
43dd50a
cc9ee69
43dd50a
bb217b1
cc9ee69
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash

# WebDAV URL
WEBDAV_URL="$WEBDAV_URL"
# WebDAV username
WEBDAV_USER="$WEBDAV_USER"
# WebDAV password
WEBDAV_PASSWORD="$WEBDAV_PASSWORD"

# Get current time
current_time=$(date +"%Y-%m-%d %H:%M:%S")
# Log file path
# LOG_FILE="${WORKDIR}/buildlog.txt"

# Start PostgreSQL service
/usr/local/bin/docker-entrypoint.sh postgres &

# Wait for PostgreSQL service to start
echo "Waiting for PostgreSQL service to start..."
until pg_isready -h localhost; do
  sleep 3
done
echo "PostgreSQL service started!"

# Run database import script
echo "Running database import script..."
${WORKDIR}/import-db.sh

# Set N8N environment variables
export N8N_ENCRYPTION_KEY="n8n8n8n"
# Allow use of all built-in modules
export NODE_FUNCTION_ALLOW_BUILTIN=*
# Allow use of external npm modules
export NODE_FUNCTION_ALLOW_EXTERNAL=*
# Activate automatic data pruning
export EXECUTIONS_DATA_PRUNE=true
# Number of hours after execution that n8n deletes data
export EXECUTIONS_DATA_MAX_AGE=36
# Number of executions to store
export EXECUTIONS_DATA_PRUNE_MAX_COUNT=1000
# Save executions ending in errors
export EXECUTIONS_DATA_SAVE_ON_ERROR=all
# Save successful executions
export EXECUTIONS_DATA_SAVE_ON_SUCCESS=all
# Don't save node progress for each execution
export EXECUTIONS_DATA_SAVE_ON_PROGRESS=false
# Don't save manually launched executions
export EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=false

# Check if log file exists on WebDAV
# echo "Checking if ${WEBDAV_URL}buildlog.txt exists"
# if curl -u "$WEBDAV_USER:$WEBDAV_PASSWORD" -f -o "$LOG_FILE" "${WEBDAV_URL}buildlog.txt"; then
#     echo "Log file downloaded and written to deployment time: ${LOG_FILE}"
#     echo "hf deployment time: ${current_time}" >> "${LOG_FILE}"
# else
#     echo "WebDAV log file does not exist, creating new log file: ${LOG_FILE}"
#     touch "${LOG_FILE}"
#     echo "hf deployment time: ${current_time}" >> "${LOG_FILE}"
# fi

# Run n8n with absolute path
n8n > /dev/null 2>&1