ci: harden Jenkins credential handling
这个提交包含在:
父节点
144fd80f65
当前提交
9a1d351468
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@ -4,8 +4,7 @@ pipeline {
|
||||
environment {
|
||||
NEXUS_REGISTRY = 'https://nexus.xuqinmin.com/repository/npm-hosted/'
|
||||
NEXUS_READ_REGISTRY = 'https://nexus.xuqinmin.com/repository/npm/'
|
||||
GIT_URL = 'https://xuqinmin.com/xuqmGroup/XuqmGroup-RNSDK.git'
|
||||
ANDROID_SDK_GIT_URL = 'https://xuqinmin.com/xuqmGroup/XuqmGroup-AndroidSDK.git'
|
||||
ANDROID_SDK_GIT_URL = 'ssh://git@xuqinmin.com:2222/xuqmGroup/XuqmGroup-AndroidSDK.git'
|
||||
}
|
||||
|
||||
options {
|
||||
@ -254,18 +253,19 @@ pipeline {
|
||||
continue
|
||||
}
|
||||
echo "Publishing ${mod} from ${dir} (tag: ${env.NPM_TAG})"
|
||||
bat """
|
||||
copy .npmrc ${dir}\\.npmrc
|
||||
pnpm --dir ${dir} publish --tag ${env.NPM_TAG} --registry %NEXUS_REGISTRY% --no-git-checks
|
||||
del ${dir}\\.npmrc 2>nul || exit 0
|
||||
"""
|
||||
try {
|
||||
bat "powershell -NonInteractive -Command \"Copy-Item -LiteralPath '.npmrc' -Destination '${dir}\\\\.npmrc' -Force\""
|
||||
bat "pnpm --dir ${dir} publish --tag ${env.NPM_TAG} --registry %NEXUS_REGISTRY% --no-git-checks"
|
||||
} finally {
|
||||
bat "powershell -NonInteractive -Command \"Remove-Item -LiteralPath '${dir}\\\\.npmrc' -Force -ErrorAction SilentlyContinue\""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
bat 'del .npmrc 2>nul || exit 0'
|
||||
bat "powershell -NonInteractive -Command \"Remove-Item -LiteralPath '.npmrc' -Force -ErrorAction SilentlyContinue\""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -463,5 +463,24 @@ pnpm --dir packages/update test
|
||||
- 同一脚本为每个 Android variant 生成自动初始化、buildId 与 BugCollect 构建开关
|
||||
元数据。RN 宿主无需额外应用 Android `com.xuqm.common` 插件;Debug 自动上报
|
||||
保持关闭,Release 根据统一构建参数决定。
|
||||
- `@xuqm/rn-update@0.5.0-alpha.15` 已由 Jenkins 发布。App4 的 Debug 构建已证明
|
||||
签名配置进入 APK;本次元数据修复仍需发布下一 alpha 后完成模拟器日志复核。
|
||||
- `@xuqm/rn-update@0.5.0-alpha.16` 已由 Jenkins `sdk-rn-publish #67` 发布。
|
||||
App4 使用 Nexus 精确版本完成 481 tasks Debug 构建、安装与冷启动,日志确认原生
|
||||
签名配置和平台开关均已加载,不再出现 common 插件缺失或配置未找到。
|
||||
|
||||
### 2026-07-27 / Jenkins npm 凭据文件生命周期修复
|
||||
|
||||
- Jenkins Windows 发布阶段原先使用 `copy .npmrc package\\.npmrc`,真实日志中该
|
||||
命令的路径解析不稳定;同时同一批处理块在 publish 失败时不会执行子包凭据文件
|
||||
删除。该问题不改变 npm 包内容,但会让失败工作区残留临时认证文件。
|
||||
- 发布循环改为 PowerShell `Copy-Item`,每个包的 `pnpm publish` 使用
|
||||
`try/finally` 独立清理子包 `.npmrc`;阶段 `post.always` 继续清理根 `.npmrc`。
|
||||
凭据仍只从 Jenkins `NEXUS_CREDS` 注入,不写入仓库、构建归档或 npm 制品。
|
||||
- 本修改尚未触发 Jenkins 验证;发布前必须先完成 Jenkinsfile 语法校验和一次真实
|
||||
alpha 发布,确认成功与失败路径均不会保留 `.npmrc`。
|
||||
- Jenkins `sdk-rn-publish` 及其余 9 个 SDK 发布作业已从含认证信息的 HTTPS SCM URL
|
||||
迁移为 `ssh://git@xuqinmin.com:2222/...`,统一绑定现有
|
||||
`jenkins-ssh-key`;作业配置二次读取确认 URL 无内嵌凭据且 credentialsId 生效。
|
||||
RN 的 Android 原生编译辅助检出同步改为 SSH URL,继续复用主 SCM 的凭据 ID。
|
||||
- 工作区内 18 个 XuqmGroup 子仓库的本地 `origin` 也已改为 SSH,审计结果不再存在
|
||||
`https://user:token@host` 形式。旧访问令牌曾出现在命令审计输出,必须在 Gitea
|
||||
轮换;本文不记录其值。
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户