Set Up Aikido Artifacts
Configure your package manager to install through Aikido Artifacts, and to publish your private packages to it.
#Prerequisites
- Aikido Artifacts enabled for your workspace. It's in beta, so contact Aikido to turn it on.
#Open the instructions
Go to Artifacts in the Aikido app, open the Instructions tab, and choose NPM, Maven, PyPi, or Go. The snippets below the selector update to match.
The tab has two sections: Publishing Instructions for your private packages, and Install Instructions for installing through the registry.
#Install packages through the registry
Add the install configuration from the Install Instructions section to your project or user configuration. Copy it from the app: the registry URL contains a token that is specific to your workspace.
| Package manager | Config file | What it sets |
|---|---|---|
| npm | .npmrc | registry=<registry-url> |
| pip | pip.conf | index-url = <registry-url> |
| Maven | settings.xml | A profile with the registry as a repository |
| Go | Environment variable | GOPROXY=<registry-url> |
The registry URL contains a token that identifies your workspace. Anyone with the URL can install through your registry. Treat it like a secret and don't commit it to a public repository.
#Publish private packages
Publishing needs a write token. Create one first, then follow the Publishing Instructions for your package manager in the app. They already contain your registry URL, so you only need to replace <write-token> with your token.
For example, to publish a package and install it again:
In your project root, create a .npmrc file and publish. <registry-host> is the registry URL without https://.
//<registry-host>/:_authToken=<write-token>
registry=<registry-url>/npm publishTo install it in another project, add the registry to its .npmrc, then run npm install:
registry=<registry-url>npm install <package-name>Create a .pypirc file, then build and upload with twine:
[distutils]
index-servers =
aikido
[aikido]
repository = <registry-url>
username = __token__
password = <write-token>python -m build
python -m twine upload --config-file .pypirc --repository aikido dist/*To install it, add the registry to your pip.conf, then run pip install:
[global]
index-url = <registry-url>
extra-index-url = https://pypi.org/simplepip install <package-name>After you publish, the version appears in My packages.