<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>同步 on Last Stand</title><link>https://amatsuzero.github.io/LastStand/tags/%E5%90%8C%E6%AD%A5/</link><description>Recent content in 同步 on Last Stand</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Wed, 21 Oct 2026 13:55:41 +0800</lastBuildDate><atom:link href="https://amatsuzero.github.io/LastStand/tags/%E5%90%8C%E6%AD%A5/index.xml" rel="self" type="application/rss+xml"/><item><title>UDC 镜像仓库迁移踩坑记录</title><link>https://amatsuzero.github.io/LastStand/posts/ugreen-notes/udc-mirror-migration/</link><pubDate>Wed, 21 Oct 2026 13:55:41 +0800</pubDate><guid>https://amatsuzero.github.io/LastStand/posts/ugreen-notes/udc-mirror-migration/</guid><description>&lt;h2 id="背景"&gt;背景&lt;/h2&gt;
&lt;p&gt;一次把 UDC 相关仓库从外部 GitLab 源迁到内网 GitLab + Nexus 的迁移，踩了十来个坑。本文把每个坑的「现象 → 根因 → 修复」记下来，方便后续再做类似镜像同步时直接对照。迁移目标是：把外部源（记为 gitlab-cloud）的仓库改写成指向内网 GitLab 的 podspec，并同步 Maven 产物到内网 Nexus。&lt;/p&gt;
&lt;h2 id="名词解释"&gt;名词解释&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pull Mirror（GitLab 原生镜像）&lt;/strong&gt;：GitLab 自带的仓库镜像功能，让镜像仓库与上游完全一致。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nexus&lt;/strong&gt;：内网私有仓库（Maven / raw 等），用来托管同步过来的二进制与 Maven 产物。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Protected 变量&lt;/strong&gt;：GitLab CI 变量标记为 Protected 后，只在保护分支 / 标签上注入。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;members/all&lt;/strong&gt;：GitLab 查组成员接口，带 /all 才会包含从父组继承的成员。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="一gitlab-原生镜像根本没法用"&gt;一、GitLab 原生镜像根本没法用&lt;/h2&gt;
&lt;p&gt;一开始想直接用 GitLab 自带的 Repository Mirroring（pull mirror），结果它和「改写 podspec URL」的需求天然冲突：原生 pull mirror 会让镜像仓库与上游完全一致，等于把我们在内网侧做的 podspec URL 改写每次同步都覆盖回去。而且源仓库里的 podspec 仍带外部域名，我们用的同步 bot 是源项目的只读成员，push 回源会 403 &amp;ldquo;not allowed to upload code&amp;rdquo;——源仓库修不了。&lt;/p&gt;</description></item></channel></rss>