Next-gen CLI tool for Katello (Katello-specific commands)
Ruby Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

hammer-cli-katello Build Status Coverage Status

Next-gen CLI tool for Katello (Katello-specific commands)

hammer-cli development docs for help

Development setup

With this guide, you'll be able to set up hammer-cli-katello, hammer-cli, katello_api, and hammer-cli-foreman for development.

Requirements for this setup

These are the requirements for this setup. Note that some may not be needed at all depending on your setup.

  • git
  • ruby
  • rvm
  • katello

Steps

First, cd into the directory where you typically keep your projects and where hammer-cli-katello and its projects will live. Then clone everything.

git clone https://github.com/Katello/hammer-cli-katello.git

Optionally, if you want to have git checkouts for hammer-cli-katello's dependencies, check these projects out:

git clone https://github.com/theforeman/hammer-cli.git
git clone https://github.com/theforeman/hammer-cli-foreman.git
git clone https://github.com/theforeman/hammer-cli-foreman-tasks.git

Now let's setup our rvm environment files for the project.

cd hammer-cli-katello
echo "1.9.3" > .ruby-version
echo "hammer" > .ruby-gemset
cd ..; cd -

Before we bundle, we need to setup our local Gemfile. Edit Gemfile.local.rb in your hammer-cli-katello directory to point to the local projects instead of using the gems.

If you're using local checkouts, enter the following:

# vim:ft=ruby
gem 'hammer_cli', :path => '../hammer-cli'
gem 'hammer_cli_foreman', :path => '../hammer-cli-foreman'
gem 'hammer_cli_foreman_tasks', :path => '../hammer-cli-foreman-tasks'

Otherwise enter:

gem 'hammer_cli_foreman', :git => 'https://github.com/theforeman/hammer-cli-foreman.git'
gem 'hammer_cli', :git => 'https://github.com/theforeman/hammer-cli.git'

Now run bundler inside your hammer-cli-katello directory:

gem install bundler
bundle install

Now, let's create the directories we need for configuration.

mkdir -p ~/.hammer/cli.modules.d

Edit ~/.hammer/cli_config.yml and enter any hammer-cli config values you want.

Next edit ~/.hammer/cli.modules.d/foreman.yml and enter the following:

:foreman:
  :enable_module: true
  :host: 'http://localhost:3000/'
  :username: 'admin'
  :password: 'changeme'

Edit ~/.hammer/cli.modules.d/katello.yml and enter in the following:

:katello:
  :enable_module: true

And then finally test out your installation:

bundle exec hammer -vh

Look for any errors. If you see none, you should be good to go.

Testing

hammer-cli-foreman stubs the API for functional tests. See api_expectations.rb. To regenerate the stubbed API, refer to the test data Readme.