File size: 1,812 Bytes
bb217b1
 
8613173
 
 
 
148af65
f991908
148af65
bb217b1
 
 
 
 
 
 
 
 
 
 
 
34f01fa
bb217b1
148af65
bb217b1
148af65
bb217b1
148af65
bb217b1
148af65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43dd50a
 
 
 
 
 
 
 
 
bb217b1
 
f991908
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
#!/bin/bash

WEBDAV_URL="$WEBDAV_URL"
WEBDAV_USER="$WEBDAV_USER"
WEBDAV_PASSWORD="$WEBDAV_PASSWORD"

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

# 启动 PostgreSQL 服务
/usr/local/bin/docker-entrypoint.sh postgres &

# 检查 PostgreSQL 服务是否已启动
echo "等待 PostgreSQL 服务启动..."
until pg_isready -h localhost; do
  sleep 3
done
echo "PostgreSQL 服务已启动!"

# 执行数据库导入脚本
echo "运行数据库导入脚本..."
${WORKDIR}/import-db.sh

# 设置 N8N 环境变量
export N8N_ENCRYPTION_KEY="n8n8n8n"
# 允许使用所有内建模块
export NODE_FUNCTION_ALLOW_BUILTIN=*
# 允许使用外部 npm 模块
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

# echo "检查 ${WEBDAV_URL}buildlog.txt 是否存在"
# if curl -u "$WEBDAV_USER:$WEBDAV_PASSWORD" -f -o "$LOG_FILE" "${WEBDAV_URL}buildlog.txt"; then
#     echo "日志文件下载成功并写入部署时间: ${LOG_FILE}"
#     echo "hf部署时间: ${current_time}" >> "${LOG_FILE}"
# else
#     echo "WebDAV 上日志文件不存在,创建新的日志文件: ${LOG_FILE}"
#     touch "${LOG_FILE}"
#     echo "hf部署时间: ${current_time}" >> "${LOG_FILE}"
# fi

# 使用绝对路径调用 n8n
n8n > /dev/null 2>&1