Skip to content

Commit 280904c

Browse files
authored
Merge branch 'master' into enc_escape_fix
2 parents 28d54b4 + c37b929 commit 280904c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+235
-121
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "bundler" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/main.yml

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
11
name: CI
22
on: [push, pull_request, workflow_dispatch]
33
jobs:
4-
puppet-3-8-7:
5-
env:
6-
PUPPET_VERSIONS: "3.8.7"
7-
PUPPET_VERSION: "3.8.7"
8-
RUBOCOP_TEST: false
9-
RSPEC_TEST: true
10-
runs-on: ubuntu-latest
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
ruby-version: ["2.0", "2.1"]
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v1
18-
- name: Build container
19-
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}
20-
- name: Tests
21-
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
22-
234
puppet-4-10-10:
245
env:
256
PUPPET_VERSIONS: "4.10.10"
@@ -30,31 +11,31 @@ jobs:
3011
strategy:
3112
fail-fast: false
3213
matrix:
33-
ruby-version: ["2.1", "2.2", "2.3"]
14+
ruby-version: ["2.6"]
3415
steps:
3516
- name: Checkout code
3617
uses: actions/checkout@v1
3718
- name: Build container
38-
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}
19+
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}} --build-arg PUPPET_VERSION=${{env.PUPPET_VERSION}}
3920
- name: Tests
4021
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
4122

42-
puppet-5-5-8:
23+
puppet-5-5-22:
4324
env:
44-
PUPPET_VERSIONS: "5.5.8"
45-
PUPPET_VERSION: "5.5.8"
25+
PUPPET_VERSIONS: "5.5.22"
26+
PUPPET_VERSION: "5.5.22"
4627
RUBOCOP_TEST: false
4728
RSPEC_TEST: true
4829
runs-on: ubuntu-latest
4930
strategy:
5031
fail-fast: false
5132
matrix:
52-
ruby-version: ["2.4", "2.5", "2.6"]
33+
ruby-version: ["2.6"]
5334
steps:
5435
- name: Checkout code
5536
uses: actions/checkout@v1
5637
- name: Build container
57-
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}-stretch
38+
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}} --build-arg PUPPET_VERSION=${{env.PUPPET_VERSION}}
5839
- name: Tests
5940
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
6041

@@ -68,20 +49,14 @@ jobs:
6849
strategy:
6950
fail-fast: false
7051
matrix:
71-
ruby-version: ["2.5", "2.6"]
52+
ruby-version: ["2.6"]
7253
steps:
7354
- name: Checkout code
7455
uses: actions/checkout@v1
7556
- name: Build container
76-
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}-stretch
57+
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}} --build-arg PUPPET_VERSION=${{env.PUPPET_VERSION}}
7758
- name: Tests
7859
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
79-
- name: Rubocop and Coverage
80-
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild
81-
if: matrix.ruby-version == '2.6'
82-
env:
83-
RUBOCOP_TEST: true
84-
ENFORCE_COVERAGE: true
8560

8661
puppet-7-3-0:
8762
env:
@@ -93,13 +68,11 @@ jobs:
9368
strategy:
9469
fail-fast: false
9570
matrix:
96-
# 2.7 and 3.0 fail at the moment
97-
# ruby-version: ["2.5", "2.6", "2.7", "3.0"]
98-
ruby-version: ["2.5", "2.6"]
71+
ruby-version: ["2.6"]
9972
steps:
10073
- name: Checkout code
10174
uses: actions/checkout@v1
10275
- name: Build container
103-
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}}-buster
76+
run: docker build . --file Dockerfile --tag octocatalog-diff:ruby${{matrix.ruby-version}} --build-arg RUBY_VERSION=${{matrix.ruby-version}} --build-arg PUPPET_VERSION=${{env.PUPPET_VERSION}}
10477
- name: Tests
10578
run: docker run -e PUPPET_VERSION -e PUPPET_VERSIONS -e RSPEC_TEST -e RUBOCOP_TEST -e ENFORCE_COVERAGE octocatalog-diff:ruby${{matrix.ruby-version}} /app/script/cibuild

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- '*.*.*'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
name: Build and Release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
packages: write
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Ruby
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: '2.6'
21+
- run: bundle install
22+
23+
- name: Publish to GPR
24+
env:
25+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
26+
run: |
27+
mkdir -p $HOME/.gem
28+
touch $HOME/.gem/credentials
29+
chmod 0600 $HOME/.gem/credentials
30+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
31+
gem build *.gemspec
32+
if [ ${{ github.ref_type }} == "tag" ]; then
33+
gem push --verbose \
34+
--key github \
35+
--host https://rubygems.pkg.github.com/${{ github.repository_owner }} \
36+
*.gem
37+
fi
38+
- name: Upload gem as action artifact
39+
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
40+
if: ${{ always() }}
41+
with:
42+
path: ./*.gem

.rubocop.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Style/Documentation:
5757
Enabled: false
5858

5959
# To fix later
60+
Style/FormatStringToken:
61+
Enabled: false
6062
Style/PercentLiteralDelimiters:
6163
Enabled: false
6264
Style/VariableNumber:
@@ -73,7 +75,13 @@ Style/EmptyMethod:
7375
Enabled: false
7476
Style/SymbolArray:
7577
Enabled: false
76-
Style/IndentHeredoc:
78+
Style/YodaCondition:
79+
Enabled: false
80+
Layout/HeredocIndentation:
81+
Enabled: false
82+
Layout/ExtraSpacing:
83+
Enabled: false
84+
Performance/Caller:
7785
Enabled: false
78-
Style/ExtraSpacing:
86+
Style/WordArray:
7987
Enabled: false

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ RUN sed -i'' -e 's/CipherString = DEFAULT@SECLEVEL=2/CipherString = DEFAULT@SECL
88
RUN sed -i'' -e 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /etc/ssl/openssl.cnf
99

1010
FROM scratch AS app
11+
ARG PUPPET_VERSION
12+
ENV PUPPET_VERSION="${PUPPET_VERSION}"
1113
COPY --from=ruby / /
1214
WORKDIR /app
1315
ENV LANG="C.UTF-8"

config/puppet-versions.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
[
2-
{
3-
"minimum_version": "3.0.0",
4-
"maximum_version": "3.99.99",
5-
"additional_gems": [
6-
{ "name": "safe_yaml", "version": "~> 1.0.4" },
7-
{ "name": "puppetdb-terminus", "version": "3.2.4" }
8-
]
9-
},
102
{
113
"minimum_version": "4.0.0",
124
"maximum_version": "4.99.99",

doc/configuration-puppetdb.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The following settings can be used in a [configuration file](/doc/configuration.
3232
| --- | --- |
3333
| `settings[:puppetdb_url]` | PuppetDB URL settings. If this is a string, it will set a single PuppetDB URL. If it is an array, it will set multiple URLs, which will be tried in a random order until one responds. |
3434
| `settings[:puppetdb_ssl_ca]` | Path to the certificate of the CA that signed PuppetDB's certificate. This file should contain only the public certificate, so it is safe to distribute to developer workstations or CI environments. |
35+
| `settings[:puppetdb_ssl_crl]` | Path to the Certificate Revocation List provided by Puppetserver.
3536
| `settings[:puppetdb_ssl_client_cert]` | TEXT of the certificate of the client SSL keypair used to authenticate to PuppetDB. Note: This variable is not set to a file path, which means you will likely want to use `File.read(...)` if you are configuring this to be read from a file. |
3637
| `settings[:puppetdb_ssl_client_key]` | TEXT of the private key of the client SSL keypair used to authenticate to PuppetDB. Note: This variable is not set to a file path, which means you will likely want to use means you will likely want to use `File.read(...)` if you are configuring this to be read from a file. |
3738
| `settings[:puppetdb_ssl_client_pem]` | Concatenation of the text of `puppetdb_ssl_client_key` and `puppetdb_ssl_client_cert` as previously described. This is a good alternative if your certificate chain is complex and it's easier just to put everything in a single place. Note: this option is second in precedence; if `settings[:puppetdb_ssl_client_cert]` and `settings[:puppetdb_ssl_client_key]` are both set, this will be ignored. |
@@ -46,6 +47,7 @@ The following arguments can be used on the command line.
4647
| --- | --- |
4748
| --puppetdb-url https://puppetdb.example.net:8081 | PuppetDB URL. The argument should match the `server_urls` configuration setting as described previously. Please note that only one URL is supported via the command line method, so if you have multiple `server_urls` URLs specified, you can only choose one. To use multiple URLs for failover purposes, please configure via configuration files. |
4849
| --puppetdb-ssl-ca FILENAME | Path to the certificate of the CA that signed PuppetDB's certificate. This file should contain only the public certificate, so it is safe to distribute to developer workstations or CI environments. |
50+
| --puppetdb-ssl-crl FILENAME | Path to the Certificate Revocation List of the CA that signed PuppetDB's certificate. |
4951
| --puppetdb-ssl-client-cert FILENAME | Path to the certificate of the client SSL keypair. |
5052
| --puppetdb-ssl-client-key FILENAME | Path to the private key of the client SSL keypair. |
5153
| --puppetdb-ssl-client-password PASSWORD_STRING | Plain text string containing the password to unlock the private key. For keys generated by the Puppet Master CA, this is not required. |

doc/optionsref.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ Usage: octocatalog-diff [command line options]
106106
--puppetdb-token-file PATH Path containing token for PuppetDB API, relative or absolute
107107
--puppetdb-url URL PuppetDB base URL
108108
--puppetdb-ssl-ca FILENAME CA certificate that signed the PuppetDB certificate
109+
--puppetdb-ssl-crl FILENAME Certificate Revocation List of the CA that signed PuppetDB's certificate.
109110
--puppetdb-ssl-client-cert FILENAME
110111
SSL client certificate to connect to PuppetDB
111112
--puppetdb-ssl-client-key FILENAME
@@ -1440,6 +1441,19 @@ matches the name you are using to connecting. (<a href="../lib/octocatalog-diff/
14401441
</td>
14411442
</tr>
14421443

1444+
<tr>
1445+
<td valign=top>
1446+
<pre><code>--puppetdb-ssl-crl FILENAME</code></pre>
1447+
</td>
1448+
<td valign=top>
1449+
Certificate Revocation List that is supplied by Puppetserver
1450+
</td>
1451+
<td valign=top>
1452+
Specify the Certificate Revocation List file.
1453+
(<a href="../lib/octocatalog-diff/cli/options/puppetdb_ssl_crl.rb">puppetdb_ssl_crl.rb</a>)
1454+
</td>
1455+
</tr>
1456+
14431457
<tr>
14441458
<td valign=top>
14451459
<pre><code>--puppetdb-ssl-client-cert FILENAME</code></pre>

examples/octocatalog-diff.cfg.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,19 @@ def self.config
9292
# If you don't specify this, SSL will still work, but the tool won't verify the certificate
9393
# of the puppetdb server it's connecting to.
9494
# More: https://github.com/github/octocatalog-diff/blob/master/doc/configuration-puppetdb.md
95+
#
9596
##############################################################################################
9697

9798
# settings[:puppetdb_ssl_ca] = '/etc/puppetlabs/puppet/ssl/certs/ca.pem'
9899

100+
##############################################################################################
101+
# puppetdb_ssl_crl
102+
# Certificate Revocation List provided by Puppetserver. You can specify an absolute path starting with `/`, or a relative path.
103+
#
104+
##############################################################################################
105+
106+
# settings[:puppetdb_ssl_crl] = '/etc/puppetlabs/puppet/ssl/crl.pem'
107+
99108
##############################################################################################
100109
# puppetdb_ssl_client_key
101110
# puppetdb_ssl_client_password

0 commit comments

Comments
 (0)