Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding guidance on local HTML docs gen #328

Merged
merged 6 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ html/
.idea_modules/
atlassian-ide-plugin.xml
.vscode

# rbenv
.ruby-version
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# kitchen-salt #

[![Gem Version](https://badge.fury.io/rb/kitchen-salt.svg)](https://badge.fury.io/rb/kitchen-salt)
[![Gem Downloads](https://ruby-gem-downloads-badge.herokuapp.com/kitchen-salt?type=total&color=brightgreen)](https://rubygems.org/gems/kitchen-salt)
[![Build Status](https://github.com/saltstack/kitchen-salt/workflows/Tests/badge.svg)](https://github.com/saltstack/kitchen-salt/actions)
Expand All @@ -9,6 +10,28 @@ The provider works by generating a salt-minion config, creating pillars based on

This provisioner is tested with kitchen-docker against CentOS, Ubuntu, and Debian.

## Documentation ##
## Installation and Setup ##

You'll need the test-kitchen and kitchen-salt gem's installed in your system, along with kitchen-vagrant or some other suitable driver for test-kitchen. Please see the [gettingstarted documentation](docs/gettingstarted.md).

To generate more detailed documentation of ruby classes, in an HTML rendered local website for viewing,
please the documentation on how to [Generate and locally view docs](docs/gettingstarted.md#generate-and-locally-view-docs).

## Provisioner Options ##

More details on all the configuration options are in the [provisioner_options documentation](docs/provisioner_options.md).

## Requirements ##

You'll need a driver box that is supported by the SaltStack [bootstrap](https://github.com/saltstack/salt-bootstrap) system.

## Continuous Integration and Testing ##

PR's and other changes should validated using Github Actions, kitchen-docker, multiple state dependencies, the modified version of kitchen-salt and the latest version of test-kitchen.

## Releasing ##

<https://kitchen.saltproject.io>
# hack. work. test.
git add stuff
git commit -v
gem bump --release --tag
42 changes: 24 additions & 18 deletions docs/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,19 @@ For Linux, there is an [installer script](https://github.com/rbenv/rbenv-install

The following instructions will allow for a global install of rbenv.

1. Install the dependencies for building ruby
- centos

sudo yum install -y openssl-devel readline-devel zlib-devel bzip2 gcc make git

- ubuntu

sudo apt update
sudo apt install -y libssl-dev libreadline-dev zlib1g-dev bzip2 gcc make git
1. Install the dependencies for building ruby, referencing the `ruby-build` [Suggested build environment](https://github.com/rbenv/ruby-build/wiki#suggested-build-environment) documentation.

1. clone git repos and setup path

sudo git clone git://github.com/rbenv/rbenv.git /usr/local/rbenv
sudo mkdir /usr/local/rbenv/plugins
sudo git clone git://github.com/rbenv/ruby-build.git /usr/local/rbenv/plugins/ruby-build
sudo tee /etc/profile.d/rbenv.sh <<< 'export PATH="/usr/local/rbenv/plugins/ruby-build/bin:/usr/local/rbenv/bin:$PATH"'
sudo tee -a /etc/profile.d/rbenv.sh <<< 'source <(rbenv init -)'
- [Basic GitHub Checkout/setup of rbenv](https://github.com/rbenv/rbenv#basic-github-checkout)
- [Installation of `ruby-build`](https://github.com/rbenv/ruby-build#installation)

now the shell needs to be restarted so that the rbenv commands are in the path, and then `rbenv init -` adds the shims path to the PATH as well.

1. Install ruby and set it as the version to use by default
1. Install ruby and set `2.6.3` as the version to use by default. Salt uses this version of Ruby in CI pipelines, which is why it is preferred here, but newer versions of ruby may work without issue.

rbenv install 2.6.3
rbenv global 2.6.3
rbenv local 2.6.3
# OPTIONAL: Set global default version
# rbenv global 2.6.3

If gemsets are needed, the [rbenv-gemset](https://github.com/jf/rbenv-gemset) plugin can be added to the gemsets repository.

Expand Down Expand Up @@ -122,6 +111,23 @@ To specify only installing certain groups, use the `--with` and `--without` argu

bundle install --with windows --without docker

## Generate and locally view docs ##

To view the docs that were originally generated by this repository and hosted by Salt Project, the following should generate a local copy of the documentation.

# Clear any locally generated documentation
rm -rf html/

# Generate HTML documentation of kitchen-salt
ScriptAutomate marked this conversation as resolved.
Show resolved Hide resolved
bundle install
bundle exec yard doc
firefox html/index.html

# OPTIONAL
# Start a local http server to view the rendered docs
# Accessible via http://localhost:8808/
bundle exec yard server docroot=html/

## Setup ##

Now the `.kitchen.yml` file needs to be setup for running tests. The following sections should be copied into the {file:docs/example-kitchen.yml.md} file in the root of the directory for the `wordpress-formula`
Expand Down