Pushing a Debian package to a registry
This guide describes how to push a Debian package to a local registry.
To push a Debian package to a registry, you need the cloud-registry.artifacts.pusher role or higher.
-
Create the following environment variables depending on the authentication method:
IAM tokenAPI key-
Get an IAM token for the Yandex account or service account you are going to use for authentication.
-
Create the
REGISTRY_USERNAMEandREGISTRY_PASSWORDenvironment variables:export REGISTRY_USERNAME="iam" export REGISTRY_PASSWORD="<IAM_token>"Where:
REGISTRY_USERNAME: Authentication method.REGISTRY_PASSWORD: Body of the previously obtained IAM token.
Note
The IAM token's lifetime is limited to 12 hours.
-
Create an API key for the service account you are going to use for authentication.
-
Create the
REGISTRY_USERNAMEandREGISTRY_PASSWORDenvironment variables:export REGISTRY_USERNAME="api_key" export REGISTRY_PASSWORD="<API_key>"Where:
REGISTRY_USERNAME: Authentication method.REGISTRY_PASSWORD: Body of the previously created API key.
Note
The API key maximum lifetime is set manually when you create the key.
-
-
Run this HTTP request to push your package:
curl \ --url-query "dist=<distribution>" \ --url-query "comp=<component>" \ --user "${REGISTRY_USERNAME}:${REGISTRY_PASSWORD}" \ --upload-file "<package>.deb" \ "https://registry.yandexcloud.net/debian/<registry_ID>"
dput
-
Select the authentication method:
IAM tokenAPI keyGet an IAM token for the Yandex account or service account you are going to use for authentication.
Note
The IAM token's lifetime is limited to 12 hours.
Create an API key for the service account you are going to use for authentication.
Note
The API key maximum lifetime is set manually when you create the key.
-
Add the following registry configuration to the
/etc/dput.cffile:[ycr] fqdn = registry.yandexcloud.net incoming = /debian/<registry_ID>/upload/ login = <login> method = https allow_unsigned_uploads = 1Where:
<registry_ID>: Your registry ID.login: Authentication method,iamorapi_key.
-
Upload the package:
dput ycr <package>.changesWhere
<package>.changesis the package change file generated during the compilation.