ARTIFACTORY: How to Configure Artifactory with Chef Repositories
First, install the Chef Development Kit (ChefDK). Note: The Knife command-line tool does not
support basic authentication, only authentication with RSA keys. If your Artifactory instance requires
authentication, you'll need to install RubyGems knife-art plugin. For installation instructions, please
refer to the Artifactory User Guide.
To configure a Knife client to work with Artifactory:
- Create Chef repositories using the Quick Setup. This will create a virtual Chef repository that aggregates a remote (chef-remote) and a local (chef-local) repositories.
- Edit your knife.rb file (located in $USER_HOME/.chef/). If it doesn’t exist, create it using this
$ vim knife.rb
In the following example, as Artifactory requires authentication, we added a basic
authentication configuration to the URL. To do this yourself, you will need to install the knife-
art plugin mentioned in the prerequisites above. To check whether the plugin was installed successfully you can use the command knife artifactory:
3. After installing and configuring the Knife client to work with Artifactory, you'll need to resolve a package from the default Chef registry:
The seven_zip package is successfully installed.
How to deploy your own cookbook to Artifactory
- Here’s an example of a new cookbook that’s been generated in the cookbooks location:
- After creating the cookbook, it is now ready for deployment to Artifactory. In order to deploy to Artifactory, we will use the following command:
- And here’s the package, successfully deployed to Artifactory: