Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
GeniusZeroTwo
ApusPay
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
ApusPay
/
update.sh
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
39 lines (34 loc) · 1.54 KB
main
Breadcrumbs
ApusPay
/
update.sh
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
39 lines (34 loc) · 1.54 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!/usr/bin/env bash
set -e
echo "=========================================="
echo " ApusPay 服务端一键平滑更新"
echo "=========================================="
cd "$(dirname "$0")"
echo "--> [1/3] 正在拉取远程 main 分支最新代码..."
git pull origin main
# 判断部署模式并执行更新
if command -v docker >/dev/null 2>&1 && [ -f "docker-compose.yml" ] && docker compose ps >/dev/null 2>&1; then
echo "--> [2/3] 检测到运行中的 Docker 容器,正在重新构建镜像..."
docker compose build --pull
echo "--> [3/3] 重新启动容器服务 (保持持久化数据)..."
docker compose up -d --remove-orphans
echo "--> 检查容器运行状态:"
docker compose ps
elif command -v bun >/dev/null 2>&1; then
echo "--> [2/3] 检测到原生 Bun 环境,安装最新依赖并构建前端..."
bun install --frozen-lockfile
bun run build
echo "--> [3/3] 前端构建完成!"
if command -v pm2 >/dev/null 2>&1 && (pm2 list | grep -q "apuspay"); then
echo "--> 正在通过 PM2 重载服务..."
pm2 reload apuspay
else
echo "--> 提示: 若使用 systemctl 或后台进程运行,请执行对应重启命令,例如:"
echo " systemctl restart apuspay 或 pm2 restart apuspay"
fi
else
echo "--> [提示] 代码已拉取完成,请根据您服务器的实际环境执行构建与重启。"
fi
echo "=========================================="
echo " 更新完成!数据安全保留"
echo "=========================================="
You can’t perform that action at this time.