Skip to content

Commit

Permalink
Release prep
Browse files Browse the repository at this point in the history
  • Loading branch information
op-ct committed Jan 6, 2021
1 parent 3bb7345 commit 1e2dfb3
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 16 deletions.
23 changes: 20 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,30 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.2.0]

**Added**

* New example plan, `github_inventory::git_clone`, which clones repo Targets
into a local directory.

**Changed**

* Renamed Target fact `name` to `_name` to prevent Bolt `apply()` Puppet
compiles from failing with `Cannot reassign variable '$name'` errors

**Fixed**

* Fixed syntax and logic bugs in example plan `github_inventory::count`

## [0.1.0]

**Features**
**Added**

* Initial project
* Inventory plugin that returns GitHub org repos as `local` transport Targets
* Example Bolt project with working Plans and `inventory.yaml`

[Unreleased]: https://github.com/op-ct/puppet-github_inventory
[0.1.0]: https://github.com/op-ct/puppet-github_inventory/releases/tag/0.1.0
[Unreleased]: https://github.com/bolterrific/puppet-github_inventory/compare/0.2.0...HEAD
[0.1.0]: https://github.com/bolterrific/puppet-github_inventory/releases/tag/0.1.0
[0.2.0]: https://github.com/bolterrific/puppet-github_inventory/compare/0.1.0...0.2.0
6 changes: 3 additions & 3 deletions Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
moduledir '.modules'

mod 'nwops/debug', '0.2.0'
mod 'voxpupuli-format',
:git => 'https://github.com/voxpupuli/puppet-format.git'

mod 'format',
git: 'https://github.com/voxpupuli/puppet-format.git',
ref: '6f1d387e14af9d7a92ed163692574506cc271860'
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<!-- vim-markdown-toc GFM -->

* [Description](#description)
* [Why is this useful?](#why-is-this-useful)
* [Setup](#setup)
* [Setup Requirements](#setup-requirements)
* [Beginning with github_inventory](#beginning-with-github_inventory)
Expand All @@ -23,7 +24,14 @@ Bolt]. It uses the GitHub API to dynamically provide a list of [`local`
transport] Targets that represent each repository under a GitHub org.

This module also contains an example Bolt project with a working
`inventory.yaml` and several Bolt plans.
`inventory.yaml` and several [Bolt plans].

### Why is this useful?

Using inventory Targets to represent GitHub repos enables org maintainers to
quickly scaffold Bolt plans to orchestrate org-wide changes or queries on your
GitHub repositories (and their settings).


## Setup

Expand Down Expand Up @@ -111,6 +119,7 @@ Submit PRs on the project's GitHub page.

[bolt]: https://puppet.com/docs/bolt/latest/bolt.html
[bolt-install]: https://puppet.com/docs/bolt/latest/bolt_installing.html
[Bolt Plans]: https://puppet.com/docs/bolt/latest/plans.html
[inventory file]: https://puppet.com/docs/bolt/latest/inventory_file_v2.html
[inventory reference plugin]: https://puppet.com/docs/bolt/latest/using_plugins.html#reference-plugins
[`local` transport]: https://puppet.com/docs/bolt/latest/bolt_transports_reference.html#local
Expand Down
44 changes: 43 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Plans

* [`github_inventory::count`](#github_inventorycount): Example plan, prints number of Targets from inventory
* [`github_inventory::git_clone`](#github_inventorygit_clone): Clone all repos into a local directory
* [`github_inventory::latest_semver_tags`](#github_inventorylatest_semver_tags): Report the highest SemVer tag for each repo (that has SemVer tags)
* [`github_inventory::required_checks`](#github_inventoryrequired_checks): List and/or set which PR checks are required on each repo
* [`github_inventory::workflows`](#github_inventoryworkflows): Return repos with GitHub Actions workflows
Expand Down Expand Up @@ -74,6 +76,46 @@ Additional GEM_PATH path for ruby gems (to find `octokit`)

## Plans

### `github_inventory::count`

Example plan, prints number of Targets from inventory

#### Parameters

The following parameters are available in the `github_inventory::count` plan.

##### `targets`

Data type: `TargetSpec`

By default: `repo_targets` group from inventory

Default value: `'repo_targets'`

### `github_inventory::git_clone`

Clone all repos into a local directory

#### Parameters

The following parameters are available in the `github_inventory::git_clone` plan.

##### `targets`

Data type: `TargetSpec`

By default: `repo_targets` group from inventory

Default value: `'repo_targets'`

##### `target_dir`

Data type: `Stdlib::Absolutepath`

Local directory to clone repos into

Default value: `"${system::env('PWD')}/_repos"`

### `github_inventory::latest_semver_tags`

Report the highest SemVer tag for each repo (that has SemVer tags)
Expand Down Expand Up @@ -114,7 +156,7 @@ Data type: `TargetSpec`

By default: `repo_targets` group from inventory

Default value: `get_targets('repo_targets')`
Default value: `'repo_targets'`

##### `github_api_token`

Expand Down
2 changes: 2 additions & 0 deletions gem.deps.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Using bolt's packaged gem command, install with:
#
#
Expand Down
6 changes: 3 additions & 3 deletions inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ version: 2
config:
transport: local
local:
tmpdir:
_plugin: env_var
var: PWD
bundled-ruby: true
# # Bolt < 2.37 version of the above (platform-specific)
# interpreters:
# .rb: /opt/puppetlabs/bolt/bin/ruby
tmpdir:
_plugin: env_var
var: PWD

groups:
- name: repo_targets
Expand Down
6 changes: 1 addition & 5 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
{
"name": "bolterrific-github_inventory",
"version": "0.1.0",
"version": "0.2.0",
"author": "Chris Tessmer",
"summary": "A Bolt plugin that generates local Targets from GitHub org repositories",
"license": "Apache-2.0",
"source": "https://github.com/op-ct/puppet-github_inventory",
"project_page": "https://github.com/op-ct/puppet-github_inventory",
"issues_url": "https://github.com/op-ct/puppet-github_inventory/issues",
"dependencies": [
{
"name": "puppetlabs-ruby_plugin_helper",
"version_requirement": "0.x"
},
{
"name": "puppetlabs/ruby_task_helper",
"version_requirement": "0.x"
Expand Down

0 comments on commit 1e2dfb3

Please sign in to comment.