fix:调整ci

This commit is contained in:
liyi 2025-05-17 10:42:19 +08:00
parent 46bec40eb7
commit 804cdba152
2 changed files with 11 additions and 30 deletions

View File

@ -81,6 +81,7 @@ variables:
- export NEXT_VERSION="$(cat app_new.version)"
- bash scripts/bundle_install_and_auto_add.sh android/Gemfile vendor/bundle_android "bundle exec fastlane -v"
- gem pristine --all || true # 修复所有未编译的gem扩展
- echo -e "---\n:backtrace: false\n:bulk_threshold: 1000\n:sources:\n- https://rubygems.org\n:update_sources: true\n:verbose: true" > ~/.gemrc
script:
# 输出调试信息,便于后续排查环境问题
- echo "=== DEBUG INFO (android) ==="
@ -115,6 +116,7 @@ variables:
- export NEXT_VERSION="$(cat app_new.version)"
- bash scripts/bundle_install_and_auto_add.sh ios/Gemfile vendor/bundle_ios "bundle exec fastlane -v"
- gem pristine --all || true # 修复所有未编译的gem扩展
- echo -e "---\n:backtrace: false\n:bulk_threshold: 1000\n:sources:\n- https://rubygems.org\n:update_sources: true\n:verbose: true" > ~/.gemrc
script:
# 输出调试信息,便于后续排查环境问题
- echo "=== DEBUG INFO (ios) ==="

View File

@ -46,36 +46,15 @@ if [ $success -eq 1 ]; then
exit 0
fi
# 2. 统一执行镜像切换和重试的bundle install
try_count=0
max_try=3
success=0
bundle config mirror.https://rubygems.org https://mirrors.aliyun.com/rubygems/
while [ $try_count -lt $max_try ]; do
echo "[INFO] 第$((try_count+1))次尝试使用阿里云镜像 bundle install..."
bundle config set --local path "$BUNDLE_PATH"
bundle install --gemfile "$GEMFILE_PATH"
if [ $? -eq 0 ]; then
echo "[SUCCESS] 使用阿里云镜像 bundle install 成功"
success=1
break
fi
try_count=$((try_count+1))
sleep 2
echo "[WARN] 阿里云镜像 bundle install 第$try_count 次失败,准备重试..."
done
if [ $success -eq 0 ]; then
echo "[ERROR] 阿里云镜像 bundle install 失败$max_try次,切换为官方源重试..."
bundle config mirror.https://rubygems.org https://rubygems.org
bundle config set --local path "$BUNDLE_PATH"
bundle install --gemfile "$GEMFILE_PATH"
if [ $? -eq 0 ]; then
echo "[SUCCESS] 官方源 bundle install 成功"
else
echo "[FATAL] 官方源 bundle install 依然失败请检查网络或Gemfile配置。"
exit 2
fi
# 2. 只用 rubygems.org 官方源进行 bundle install
bundle config mirror.https://rubygems.org https://rubygems.org
bundle config set --local path "$BUNDLE_PATH"
bundle install --gemfile "$GEMFILE_PATH"
if [ $? -eq 0 ]; then
echo "[SUCCESS] 官方源 bundle install 成功"
else
echo "[FATAL] 官方源 bundle install 失败请检查网络或Gemfile配置。"
exit 2
fi
# 3. 最后再执行一次主命令校验