Private registries
Let a site's builds install packages from a private npm scope or a private Composer repository.
On this page
Before you start
- You can open the site in Managed Websites. Anyone who can open a site can add, verify and delete its registries.
- You have the registry's address and a token for it. The registry must be reachable from the internet over HTTPS.
- Each environment has its own registries: choose Production or Staging in the site header first.
Add a registry
Open the site's deployments
Go to Managed Websites, choose the site, then Deployments under Code & backups. On the Private registries card, choose Add registry.
Enter the registry details
Choose the Kind, fill in its fields and paste the Token.
Save and verify
Choose Save and verify. The registry is asked whether it accepts the token, and the row reads Verified or Invalid with the registry's answer.
The next build of this environment signs in to the registry. The token is never shown again, and it never reaches the site itself.
| Kind | Fields |
|---|---|
| npm | Registry URL, an HTTPS address such as https://npm.pkg.github.com, and the Scope, such as @acme. Leave Scope blank for the default registry. |
| Composer | Host, as in auth.json, with no https:// or path, and the Auth type: HTTP basic, Bearer, GitHub OAuth or GitLab token. HTTP basic also asks for a Username. |
An environment holds up to 20 registries, one for each address and scope. With none, builds use the public npm and Packagist registries, and the Magento keys and Shopware Store token saved on the site.
Replace a token, verify or delete
Open the registry's menu
Open the registry's … menu and choose Replace token…, Verify or Delete.
Replace token… keeps the address and username and asks only for the new token. After Delete, builds that install from that registry fail until a token is added again.
Add a registry for every site
Open the organisation's deployments
Go to Organisation › Organisations, choose your organisation, then Deployments under Developers. On the Private registries card, choose Add registry.
Builds of every site of your organisation sign in to the registry. An environment that sets its own token for the same registry keeps it.
This needs an owner, or a role with Edit Environment Deployment Pipeline, and an organisation holds up to 20.
On a CoreStack Enterprise environment, the credentials are on the environment page's Composer registries card.
Automate this
Saves the credential for one private registry and answers the whole list.
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/deployments/secrets \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"auth_type": "http-basic",
"kind": "composer",
"label": "Private packages",
"registry": "packages.example.com",
"token": "your-registry-token",
"username": "northwind-digital"
}'Your assistant calls corestack_deployments_secret_set.
{
"name": "corestack_deployments_secret_set",
"arguments": {
"site_id": 4211,
"kind": "npm",
"label": "GitHub Packages",
"registry": "https://npm.pkg.github.com",
"scope": "@acme",
"token": "<the registry token>",
"verify": true
}
}