cookbook 'depot', '= 0.3.0'
depot (6) Versions 0.3.0 Follow4
Installs/Configures Habitat Depot
cookbook 'depot', '= 0.3.0', :supermarket
knife supermarket install depot
knife supermarket download depot
Habitat Depot
This cookbook will set up a private Habitat Depot, running all the required services on one machine.
While this is tested and may work for other users, private depots are not yet supported by Chef Software, Inc. nor the Habitat project. Use at your own risk, and be aware that there is no planned migration strategy.
Requirements
- Chef 12.11 or higher (for habitat cookbook)
Platform Support
- Ubuntu 16.04
Setup
Place a dependency on the depot cookbook in your cookbook's metadata.rb.
depends 'depot', '~> 0.2.0'
Then, in a recipe:
include_recipe 'depot'
A service will be created as hab-depot
.
Attributes
name | default | description |
---|---|---|
node['depot']['oauth']['client_id'] |
nil |
Github Client ID for OAuth |
node['depot']['oauth']['client_secret'] |
nil |
Github Client Secret for OAuth |
node['depot']['fqdn'] |
node['fqdn'] or node.name
|
This will be set to the node['fqdn'] attribute, and fall back to the node.name . |
If the client_id
and client_secret
are not set, users will not be able to sign in, create origins, or upload packages to the Depot. Create an OAuth application on Github first, and then use the values for these attributes.
Local Test
Run a local Depot for testing with test kitchen.
$ kitchen converge
A VM will start up on 192.168.96.31, and will be accessible at http://192.168.96.31 from the host machine.
Once this is provisioned, it can be used for local testing. In order to upload packages, a Github OAuth application and personal access token must be created and the kitchen VM re-configured.
- Create a new OAuth application on Github. Name it
kitchen-habitat-depot
or similar. The homepage URL should behttp://192.168.96.31
. The Authorization Callback URL must behttp://192.168.96.31/#/sign-in
. Save the client ID and client secret to a shell script file that looks like this:export GITHUB_CLIENT_ID=1edd05b4912af4eed6e16b9a export GITHUB_CLIENT_SECRET=4fdedc08a0a0d9c035a321edd05b4912af4eed6e16b9a
Source this file in the shell and rerunkitchen converge
.$ . ~/.github/kitchen-habitat-depot-oauth $ kitchen converge
- Create a personal access token on Github. Name it
kitchen-habitat-depot
or similar. Give it permission touser
anduser:email
. Save the token to a file, for example~/.github/kitchen-habitat-depot
- Open the local Depot at http://192.168.96.31.
- Sign-in using Github on the sign-in page.
- Create a new origin in the UI.
- Create a new origin key on the local system and upload it to the Depot.
$ hab origin key generate kitchen-tester $ hab origin key upload --url http://192.168.96.31/v1/depot kitchen-tester -z $(cat ~/.github/kitchen-habitat-depot)
- Create packages using that origin, and then upload them to the depot!
$ hab pkg upload --url http://192.168.96.31/v1/depot somepackage.hart -z $(cat ~/.github/kitchen-habitat-depot)
Dependent cookbooks
habitat ~> 0.3.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.3.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Foodcritic Metric
0.3.0 failed this metric
FC033: Missing template: depot/recipes/default.rb:53
FC033: Missing template: depot/recipes/default.rb:68
Run with Foodcritic Version 8.2.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
License Metric
0.3.0 passed this metric
0.3.0 failed this metric
0.3.0 failed this metric
FC033: Missing template: depot/recipes/default.rb:53
FC033: Missing template: depot/recipes/default.rb:68
Run with Foodcritic Version 8.2.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
License Metric
0.3.0 passed this metric
0.3.0 passed this metric