Error Uploading Cookbook Tp Supermarket Invalid Char in Json Text
To enable calculation of Chef package metadata in local repositories so they are, in effect, Chef supermarkets, set theBundle Type to Chefwhen you create the repository:
Artifactory allows you to define any layout for your Chef Cookbook repositories. In social club to upload packages according to your custom layout, you need to package your Chef Cookbook files with Knife or Berkshelf and annal the files as tar.gz. Then y'all can upload to whatever path within your local Chef supermarket, see Publishing Cookbooks.
Artifacts (such every bit tgz files) requested from a remote repository are cached on demand. Y'all can remove downloaded artifacts from the remote repository enshroud, however, you can not manually deploy artifacts to a remote Chef repository.
To define a remote repository to proxy a remote Chef Cookbook, follow the steps below:
- In theAdministration module, underRepositories | Repositories | Remote, click New Remote Repository.
- Select Chef from the Select Package Blazon dialog.
- In the New Repository dialog, set up theRepository Primalvalue, and specify the URL to the remote repository in theURLfield as displayed below.
- Click Save & Finish.
Virtual Chef Supermarket
A Virtual Repository divers in Artifactory aggregates packages from both local and remote repositories.
This allows you to access both locally hosted Chef Cookbook packages and remote proxied Chef Cookbook repositories from a unmarried URL defined for the virtual repository.
To define a virtual Chef Cookbook repository, create a Virtual Repositories, select Chef from the Select Bundle Blazondialog, and select the underlying local and remote Chef repositories to include in theBasicsettingstab.
Using the Knife Command Line
Chef repositories must be prefixed with api/chef in the path
When accessing a Chef supermarket through Artifactory, the repository URL must be prefixed with api/chef in the path. This applies to all Knife commands.
For example, if you are using Artifactory standalone or as a local service, you would admission your Chef supermarket using the following URL:
http://localhost:8081/artifactory/api/chef/<repository key>
Or, if you lot are using Artifactory Cloud the URL would be:
https://<server name>.jfrog.io/artifactory/api/chef/<repository fundamental>
To employ the Knife control line you need to make sure information technology's installed. Information technology's part of ChefDK, that tin exist installed in various ways.
In one case y'all have created your Chef supermarket, you can select it in the Tree Browser and clickSet Me Up to become code snippets you can utilise to change your Chef supermarket URL, and deploy and resolve packages using the knife command line tool.
Prepare the default Chef supermarket with a URL pointing to a Chef supermarket in Artifactory by editing your ~/.chef/knife.rb
configuration file (the example below uses a repository with the key chef-virtual
). You authenticate the request using your username and countersign or with your Artifactory API key :
knife[:supermarket_site] = 'http://admin:password@localhost:8081/artifactory/api/chef/chef-virtual' or pocketknife[:supermarket_site] = 'http://admin:<APIKEY>@localhost:8081/artifactory/api/chef/chef-virtual'
pocketknife.rb file location
The knife.rb file doesn't exist by default. It can be created with the knife configure
command. Refer to the pocketknife documentation for possible knife.rb locations.
The location of this file can be overidden with the --config
parameter when running a knife command
Working with Artifactory without Anonymous Access
Past default, Artifactory allows Anonymous Access for Chef repositories. This is defined underSecurity | General Configuration. For details please refer to Allow Anonymous Access.
If yous want to exist able to trace how users interact with your repositories you need to uncheck the Allow Bearding Access setting. This means that users will be required to enter their username and password.
The Pocketknife command line tool does not back up bones authentication (information technology only supports authentication with RSA keys).
To enable bones authentication, you will need to install the knife-art.gem plugin.
chef gem install knife-art
If properly installed you should see the post-obit specific Artifactory commands:
** ARTIFACTORY COMMANDS ** pocketknife artifactory download COOKBOOK [VERSION] (options) pocketknife artifactory install COOKBOOK [VERSION] (options) knife artifactory list (options) knife artifactory search QUERY (options) knife artifactory share COOKBOOK [CATEGORY] (options) knife artifactory show COOKBOOK [VERSION] (options) knife artifactory unshare COOKBOOK VERSION
These commands are a wrapper around the standard Knife supermarket commands, that enable basic authentication. To add these credentials, pre-pend them to the URL of the Chef supermarket configured in your knife.rbfile:
knife[:supermarket_site] = 'http://admin:countersign@localhost:8081/artifactory/api/chef/chef-virtual'
Publishing Cookbooks
You tin can use the UI or a simple REST API telephone call to upload the tgz/tar.gz containing the Cookbook to a Chef repository.
Artifactory volition automatically extract the relevant information from themetadata.json
to later serve the index and respond properly to customer calls. This metadata.json
file is mandatory. If it does not exist in your cookbook, y'all tin can use a Knife command to generate it and so publish information technology to Artifactory. For instance:
$ chef generate cookbook myapp $ knife artifactory share myapp tool
Using the Berkshelf Command Line
From version 6.one.0, Berkshelf supports authenticated access to Artifactory using an API Key. Previous versions of Berkshelf only supported Bearding access to Artifactory.
Berkshelf is a dependency manager for Chef Cookbooks, and is a part of theChefDK.
To resolve dependencies from a Chef supermarket in Artifactory, first configure your Artifactory API Key usingconfig.rb:
artifactory_api_key "<APIKEY>"
Then set the default supermarket in your Berksfile's Cookbook:
source artifactory: 'http://localhost:8081/artifactory/api/chef/chef-virtual'
And then yous can execute theberks
command to download the required dependencies from Artifactory:
vagrant@default-ubuntu-1404:~/chef-zero/mycookbook$ berks Resolving cookbook dependencies... Fetching 'mycookbook' from source at . Fetching cookbook alphabetize from http://localhost:8081/artifactory/api/chef/chef-virtual... Installing apt (5.0.0) from http://localhost:8081/artifactory/api/chef/chef-virtual ([opscode] http://localhost:8081/artifactory/api/chef/chef-virtual/api/v1) Installing chef-apt-docker (1.0.0) from http://localhost:8081/artifactory/api/chef/chef-virtual ([opscode] http://localhost:8081/artifactory/api/chef/chef-virtual/api/v1) Installing chef-yum-docker (1.0.1) from http://localhost:8081/artifactory/api/chef/chef-virtual ([opscode] http://localhost:8081/artifactory/api/chef/chef-virtual/api/v1) Installing compat_resource (12.16.2) from http://localhost:8081/artifactory/api/chef/chef-virtual ([opscode] http://localhost:8081/artifactory/api/chef/chef-virtual/api/v1) Using mycookbook (0.ane.0) from source at . Installing yum (iv.1.0) from http://localhost:8081/artifactory/api/chef/chef-virtual ([opscode] http://localhost:8081/artifactory/api/chef/chef-virtual/api/v1)
Viewing Individual Chef Cookbook Information
Artifactory lets yous view selected metadata of a Chef Cookbook directly from the UI.
In theAwarding module, Artifactory |Artifacts tab,Tree Browser, drill down to select the tgz/tar.gz
file you lot want to audit. The metadata is displayed in theChef Info tab.
Searching Chef Cookbooks
Artifactory supports a variety of means to search for artifacts.
Artifactory besides supportspocketknife search [search terms ...]:
- For local repositories, it will await for the given terms in the name, description and maintainer fields.
- For remote repositories, the search will be done on the local cache, then the search query will be forwarded to the external repository and the results merged before returned to the client.
- For virtual repositories, the search will exist washed on local repositories and then on remote repositories, the results merged before returning to the client.
Properties
Artifactory annotates each deployed or cached Chef Cookbook package with at least three properties: chef.name , chef.version
and chef.maintainer
. If available, information technology will also add chef.dependencies, chef.platforms
multi-valued properties.
You can use Property Search to search for Chef Cookbook co-ordinate to their proper noun, version, maintainer, dependencies or platforms requirements.
Source: https://www.jfrog.com/confluence/display/JFROG/Chef+Cookbook+Repositories
Post a Comment for "Error Uploading Cookbook Tp Supermarket Invalid Char in Json Text"