Loosely inspired by the artifact-registry-yum-plugin. Allows Zypper to use GCP's Artifact Registry RPM Repositories.
Once installed, an Artifact Repo definition in /etc/zypp/repos.d/
may be configured.
However, the official GCP documentation does not take into account configuration for use with a libzypp
plugin.
The baseurl
in the entry must adhere to the following format.
baseurl=plugin:<PLUGIN_NAME>?param1=val1¶m2=val2
This Plugin requies two parameters in the baseurl
entry.
- url: The URL of the Artifact Registry Repository
- token: A GCP Service Account Credentials File located in
/etc/zypp/credentials.d/
So provided we have:
- An AR Repo url of
https://us-yum.pkg.dev/projects/my-awesome-project/my-rpms
- A Service Account file named
ar-sa.json
The baseurl
would look like:
baseurl=plugin:ArtifactRegistryPlugin?url=https://us-yum.pkg.dev/projects/my-awesome-project/my-rpms&token=ar-sa.json
Note: The Plugin looks for the Service Account JSON file in
/etc/zypp/credentials.d
. There is no need to specify the path.
Copy the following and replace PROJECT_ID
, REPO_NAME
, and SERVICE_ACCOUNT_TOKEN.json
with the appropriate values for your use case.
[artifactregistry]
name=artifactregistry
baseurl=plugin:ArtifactRegistryPlugin?url=https://us-yum.pkg.dev/projects/PROJECT_ID/REPO_NAME&token=SERVICE_ACCOUNT_TOKEN.json
enabled=1
autorefresh=0
gpgcheck=0