mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 11:02:48 +08:00
chore(stack): 切换到 default 模式,同步根目录状态
This commit is contained in:
@@ -22,6 +22,10 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: 切换到 docker-serve 模式
|
||||
shell: bash
|
||||
run: php think admin:stack:mode use docker-serve -f
|
||||
|
||||
- name: 生成 .env
|
||||
shell: bash
|
||||
env:
|
||||
@@ -29,37 +33,27 @@ jobs:
|
||||
DB_HOSTNAME: ${{ env.DB_HOSTNAME }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ ! -f .env ]; then
|
||||
cp .example.env .env
|
||||
cp .example.env .env
|
||||
|
||||
awk -v host="$DB_HOSTNAME" -v newpwd="$MYSQL_PASSWORD" '
|
||||
BEGIN { has_host = 0; has_pwd = 0; has_demo = 0 }
|
||||
$0 ~ /^HOSTNAME=/ {
|
||||
print "HOSTNAME=" host
|
||||
has_host = 1
|
||||
next
|
||||
}
|
||||
$0 ~ /^PASSWORD=/ {
|
||||
print "PASSWORD=" newpwd
|
||||
has_pwd = 1
|
||||
next
|
||||
}
|
||||
$0 ~ /^IS_DEMO=/ {
|
||||
print "IS_DEMO=true"
|
||||
has_demo = 1
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
END {
|
||||
if (!has_host) print "HOSTNAME=" host
|
||||
if (!has_pwd) print "PASSWORD=" newpwd
|
||||
if (!has_demo) print "IS_DEMO=true"
|
||||
}' .env > .env.tmp
|
||||
awk -v host="$DB_HOSTNAME" -v newpwd="$MYSQL_PASSWORD" '
|
||||
BEGIN { has_host = 0; has_pwd = 0 }
|
||||
$0 ~ /^HOSTNAME=/ {
|
||||
print "HOSTNAME=" host
|
||||
has_host = 1
|
||||
next
|
||||
}
|
||||
$0 ~ /^PASSWORD=/ {
|
||||
print "PASSWORD=" newpwd
|
||||
has_pwd = 1
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
END {
|
||||
if (!has_host) print "HOSTNAME=" host
|
||||
if (!has_pwd) print "PASSWORD=" newpwd
|
||||
}' .env > .env.tmp
|
||||
|
||||
mv .env.tmp .env
|
||||
else
|
||||
echo ".env exists in repository, skip generating/replacing."
|
||||
fi
|
||||
mv .env.tmp .env
|
||||
|
||||
- name: 打包发布文件
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user