Skip to content

Commit

Permalink
Update from choria-plugins modulesync_config
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex committed Aug 25, 2024
1 parent d728f6d commit 6bc2720
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 41 deletions.
15 changes: 0 additions & 15 deletions .circleci/config.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

name: Continuous Integration

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

jobs:
unit:
runs-on: ubuntu-latest
needs: rubocop
strategy:
matrix:
ruby:
- "2.6"
- "2.7"
- "3.0"
- "3.1"
name: Ruby ${{ matrix.ruby }}
steps:
- uses: actions/checkout@v3
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake test
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

name: Release

on:
push:
tags:
- '*'

jobs:
release:
name: Release
uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v2
with:
allowed_owner: 'choria-plugins'
secrets:
# Configure secrets here:
# https://docs.github.com/en/actions/security-guides/encrypted-secrets
username: ${{ secrets.PUPPET_FORGE_USERNAME }}
api_key: ${{ secrets.PUPPET_FORGE_API_KEY }}
32 changes: 25 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
Gemfile.lock
puppet/LICENSE
puppet/NOTICE
puppet/README.md
puppet/CHANGELOG.md
.ruby-version
*.tar.gz
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

/pkg/
/Gemfile.lock
/Gemfile.local
/vendor/
/.vendor/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/.vagrant/
/.bundle/
/.ruby-version
/coverage/
/log/
/.idea/
/.dependencies/
/.librarian/
/Puppetfile.lock
*.iml
.*.sw?
/.yardoc/
/Guardfile
bolt-debug.log
.rerun.json
39 changes: 39 additions & 0 deletions .pmtignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

/docs/
/pkg/
/Gemfile
/Gemfile.lock
/Gemfile.local
/vendor/
/.vendor/
/spec/
/Rakefile
/.vagrant/
/.bundle/
/.ruby-version
/coverage/
/log/
/.idea/
/.dependencies/
/.github/
/.librarian/
/Puppetfile.lock
/Puppetfile
*.iml
/.editorconfig
/.fixtures.yml
/.gitignore
/.msync.yml
/.overcommit.yml
/.pmtignore
/.rspec
/.rspec_parallel
/.rubocop.yml
/.sync.yml
.*.sw?
/.yardoc/
/.yardopts
/Dockerfile
/HISTORY.md
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We do not have strong guidelines on what you put in an issue, we'll gladly work

# PRs

Almost every PR will need an issue first. You do not need issues for trivial updates like typos, most documentation updates etc. But if you're doing a PR that adjusts behaviour we will need a issue to go with it.
Almost every PR will need an issue first. You do not need issues for trivial updates like typos, most documentation updates etc. But if you're doing a PR that adjusts behavior we will need a issue to go with it.

Once you have an issue note the number and once you are ready to send your PR please squash your commits then make a single commit with something like the following format:

Expand All @@ -23,7 +23,7 @@ it can be used for such and such.
To deliver this feature we had to extend, this that and the other
with new behaviours
Backwards compatability is kept
Backwards compatibility is kept
```

Please see [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/) for excellent coverage of the topic of commit messages. We don't require things to be as detailed or strict as that but it's a great resource to keep in mind.
Expand Down
22 changes: 13 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

specdir = File.join([File.dirname(__FILE__), "spec"])

require 'rake'
require "rake"
begin
require 'rspec/core/rake_task'
require 'mcollective'
rescue LoadError
require "rspec/core/rake_task"
require "mcollective"
rescue LoadError # rubocop:disable Lint/SuppressedException
end


desc "Run agent and application tests"
task :test do
require "#{specdir}/spec_helper.rb"
if ENV["TARGETDIR"]
test_pattern = "#{File.expand_path(ENV["TARGETDIR"])}/spec/**/*_spec.rb"
test_pattern = "#{File.expand_path(ENV['TARGETDIR'])}/spec/**/*_spec.rb"
else
test_pattern = 'spec/**/*_spec.rb'
test_pattern = "spec/**/*_spec.rb"
end
sh "bundle exec rspec #{Dir.glob(test_pattern).sort.join(' ')}"
end

task :default => :test
task :default => [:test]

desc "Expands the action details section in a README.md file"
task :readme_expand do
ddl_file = Dir.glob(File.join("agent/*.ddl")).first
ddl_file = Dir.glob("agent/*.ddl").first

return unless ddl_file

ddl = MCollective::DDL.new("package", :agent, false)
ddl.instance_eval(File.read(ddl_file))

lines = File.readlines("puppet/README.md").map do |line|
if line =~ /^<\!--- actions -->/
if line.match?(/^<!--- actions -->/)
[
"## Actions\n\n",
"This agent provides the following actions, for details about each please run `mco plugin doc agent/%s`\n\n" % ddl.meta[:name]
Expand Down
1 change: 0 additions & 1 deletion spec/spec.opts

This file was deleted.

17 changes: 10 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
$: << File.join([File.dirname(__FILE__), "lib"])
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

require 'rubygems'
require 'rspec'
require 'mcollective'
require 'mcollective/test'
require 'mocha'
require 'tempfile'
require "rubygems"
require "rspec"
require "mcollective"
require "mcollective/test"
require "mocha"
require "tempfile"

RSpec.configure do |config|
config.mock_with :mocha
Expand All @@ -17,3 +18,5 @@
MCollective::PluginManager.clear
end
end

Dir["./spec/support/spec/**/*.rb"].sort.each { |f| require f }

0 comments on commit 6bc2720

Please sign in to comment.