Merge pull request #20 from puppetlabs/update-actions

Add docs and update actions
This commit is contained in:
Jake Spain 2023-01-30 16:51:53 -05:00 committed by GitHub
commit e8c3e2f8ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 405 additions and 11 deletions

View file

@ -1,4 +1,4 @@
name: Release name: Release Gem
on: workflow_dispatch on: workflow_dispatch
@ -7,25 +7,77 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'puppetlabs/vmpooler-provider-gce' if: github.repository == 'puppetlabs/vmpooler-provider-gce'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Get Version
id: gv - name: Get Current Version
uses: actions/github-script@v6
id: cv
with:
script: |
const { data: response } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
})
console.log(`The latest release is ${response.tag_name}`)
return response.tag_name
result-encoding: string
- name: Get Next Version
id: nv
run: | run: |
echo "::set-output name=ver::$(grep VERSION lib/vmpooler-provider-gce/version.rb |rev |cut -d "'" -f2 |rev)" version=$(grep VERSION lib/vmpooler-provider-gce/version.rb |rev |cut -d "'" -f2 |rev)
echo "version=$version" >> $GITHUB_OUTPUT
echo "Found version $version from lib/vmpooler-provider-gce/version.rb"
- name: Generate Changelog
uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2
with:
args: >-
--future-release ${{ steps.nv.outputs.version }}
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Validate Changelog
run : |
set -e
if [[ -n $(git status --porcelain) ]]; then
echo "Here is the current git status:"
git status
echo
echo "The following changes were detected:"
git --no-pager diff
echo "Uncommitted PRs found in the changelog. Please submit a release prep PR of changes after running `./update-changelog`"
exit 1
fi
- name: Generate Release Notes
uses: docker://githubchangeloggenerator/github-changelog-generator:1.16.2
with:
args: >-
--since-tag ${{ steps.cv.outputs.result }}
--future-release ${{ steps.nv.outputs.version }}
--output release-notes.md
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tag Release - name: Tag Release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
with: with:
tag: ${{ steps.gv.outputs.ver }} tag: ${{ steps.nv.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
bodyfile: release-notes.md
draft: false draft: false
prerelease: false prerelease: false
generateReleaseNotes: true
# This step should closely match what is used in `docker/Dockerfile` in vmpooler-deployment
- name: Install Ruby jruby-9.3.6.0 - name: Install Ruby jruby-9.3.6.0
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: 'jruby-9.3.6.0' ruby-version: 'jruby-9.3.6.0'
- name: Build gem - name: Build gem
run: gem build *.gemspec run: gem build *.gemspec
- name: Publish gem - name: Publish gem
run: | run: |
mkdir -p $HOME/.gem mkdir -p $HOME/.gem

View file

@ -19,8 +19,9 @@ jobs:
matrix: matrix:
ruby-version: ruby-version:
- 'jruby-9.3.6.0' - 'jruby-9.3.6.0'
- 'jruby-9.4.0.0'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up Ruby - name: Set up Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
@ -35,8 +36,9 @@ jobs:
matrix: matrix:
ruby-version: ruby-version:
- 'jruby-9.3.6.0' - 'jruby-9.3.6.0'
- 'jruby-9.4.0.0'
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up Ruby - name: Set up Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:

View file

@ -0,0 +1,3 @@
project=vmpooler-provider-gce
user=puppetlabs
exclude_labels=maintenance

66
CHANGELOG.md Normal file
View file

@ -0,0 +1,66 @@
# Changelog
## [Unreleased](https://github.com/puppetlabs/vmpooler-provider-gce/tree/HEAD)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-gce/compare/0.4.0...HEAD)
**Merged pull requests:**
- \(RE-15111\) Migrate Snyk to Mend Scanning [\#19](https://github.com/puppetlabs/vmpooler-provider-gce/pull/19) ([yachub](https://github.com/yachub))
- \(RE-14811\) Remove DIO as codeowners [\#17](https://github.com/puppetlabs/vmpooler-provider-gce/pull/17) ([yachub](https://github.com/yachub))
- Add Snyk action [\#16](https://github.com/puppetlabs/vmpooler-provider-gce/pull/16) ([yachub](https://github.com/yachub))
- Add release-engineering to codeowners [\#15](https://github.com/puppetlabs/vmpooler-provider-gce/pull/15) ([yachub](https://github.com/yachub))
## [0.4.0](https://github.com/puppetlabs/vmpooler-provider-gce/tree/0.4.0) (2022-07-27)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-gce/compare/0.3.0...0.4.0)
**Merged pull requests:**
- \(maint\) Refactor cloud dns [\#13](https://github.com/puppetlabs/vmpooler-provider-gce/pull/13) ([sbeaulie](https://github.com/sbeaulie))
- Update googleauth requirement from \>= 0.16.2, \< 1.2.0 to \>= 0.16.2, \< 1.3.0 [\#12](https://github.com/puppetlabs/vmpooler-provider-gce/pull/12) ([dependabot[bot]](https://github.com/apps/dependabot))
## [0.3.0](https://github.com/puppetlabs/vmpooler-provider-gce/tree/0.3.0) (2022-06-21)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-gce/compare/0.2.0...0.3.0)
**Merged pull requests:**
- release prep 0.3.0 [\#11](https://github.com/puppetlabs/vmpooler-provider-gce/pull/11) ([sbeaulie](https://github.com/sbeaulie))
- \(DIO-3162\) vmpooler gce provider to support disk type \(to use ssd\) [\#10](https://github.com/puppetlabs/vmpooler-provider-gce/pull/10) ([sbeaulie](https://github.com/sbeaulie))
## [0.2.0](https://github.com/puppetlabs/vmpooler-provider-gce/tree/0.2.0) (2022-04-19)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-gce/compare/0.1.2...0.2.0)
**Implemented enhancements:**
- Set hostname for instance during create\_vm [\#8](https://github.com/puppetlabs/vmpooler-provider-gce/pull/8) ([yachub](https://github.com/yachub))
**Merged pull requests:**
- 0.2.0 release prep [\#9](https://github.com/puppetlabs/vmpooler-provider-gce/pull/9) ([yachub](https://github.com/yachub))
- Update vmpooler requirement from ~\> 1.3, \>= 1.3.0 to \>= 1.3.0, ~\> 2.3 [\#7](https://github.com/puppetlabs/vmpooler-provider-gce/pull/7) ([dependabot[bot]](https://github.com/apps/dependabot))
- Update googleauth requirement from ~\> 0.16.2 to \>= 0.16.2, \< 1.2.0 [\#6](https://github.com/puppetlabs/vmpooler-provider-gce/pull/6) ([dependabot[bot]](https://github.com/apps/dependabot))
## [0.1.2](https://github.com/puppetlabs/vmpooler-provider-gce/tree/0.1.2) (2022-01-10)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-gce/compare/0.1.1...0.1.2)
## [0.1.1](https://github.com/puppetlabs/vmpooler-provider-gce/tree/0.1.1) (2022-01-10)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-gce/compare/0.1.0...0.1.1)
## [0.1.0](https://github.com/puppetlabs/vmpooler-provider-gce/tree/0.1.0) (2022-01-10)
[Full Changelog](https://github.com/puppetlabs/vmpooler-provider-gce/compare/588e29b6e100327336bf0910ae16b6a85ffe279a...0.1.0)
**Merged pull requests:**
- Adding the cloud DNS API library and related methods [\#4](https://github.com/puppetlabs/vmpooler-provider-gce/pull/4) ([sbeaulie](https://github.com/sbeaulie))
- fix simplecov with jruby, add a .rubocop.yml config file [\#3](https://github.com/puppetlabs/vmpooler-provider-gce/pull/3) ([sbeaulie](https://github.com/sbeaulie))
- Add a release workflow for pushing to Rubygems [\#1](https://github.com/puppetlabs/vmpooler-provider-gce/pull/1) ([genebean](https://github.com/genebean))
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

236
Gemfile.lock Normal file
View file

@ -0,0 +1,236 @@
PATH
remote: .
specs:
vmpooler-provider-gce (0.4.0)
google-apis-compute_v1 (~> 0.14)
google-cloud-dns (~> 0.35.1)
googleauth (>= 0.16.2, < 1.3.0)
vmpooler (~> 2.3, >= 1.3.0)
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
bindata (2.4.14)
builder (3.2.4)
climate_control (1.2.0)
coderay (1.1.3)
concurrent-ruby (1.2.0)
connection_pool (2.3.0)
declarative (0.0.20)
deep_merge (1.2.2)
diff-lcs (1.5.0)
docile (1.4.0)
faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.15.5-java)
google-apis-compute_v1 (0.60.0)
google-apis-core (>= 0.9.1, < 2.a)
google-apis-core (0.10.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-dns_v1 (0.29.0)
google-apis-core (>= 0.9.1, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-dns (0.35.1)
google-apis-dns_v1 (~> 0.1)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
zonefile (~> 1.04)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.3.0)
googleauth (1.2.0)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
httpclient (2.8.3)
jwt (2.6.0)
memoist (0.16.2)
method_source (1.0.0)
mini_mime (1.1.2)
mock_redis (0.36.0)
ruby2_keywords
multi_json (1.15.0)
mustermann (2.0.2)
ruby2_keywords (~> 0.0.1)
net-ldap (0.17.1)
nio4r (2.5.8-java)
opentelemetry-api (1.1.0)
opentelemetry-common (0.19.6)
opentelemetry-api (~> 1.0)
opentelemetry-exporter-jaeger (0.20.1)
opentelemetry-api (~> 1.0)
opentelemetry-common (~> 0.19.2)
opentelemetry-sdk (~> 1.0)
thrift
opentelemetry-instrumentation-base (0.19.0)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-concurrent_ruby (0.19.2)
opentelemetry-api (~> 1.0)
opentelemetry-instrumentation-base (~> 0.19.0)
opentelemetry-instrumentation-http_client (0.19.4)
opentelemetry-api (~> 1.0)
opentelemetry-common (~> 0.19.3)
opentelemetry-instrumentation-base (~> 0.19.0)
opentelemetry-instrumentation-redis (0.21.3)
opentelemetry-api (~> 1.0)
opentelemetry-common (~> 0.19.3)
opentelemetry-instrumentation-base (~> 0.19.0)
opentelemetry-instrumentation-sinatra (0.19.3)
opentelemetry-api (~> 1.0)
opentelemetry-common (~> 0.19.3)
opentelemetry-instrumentation-base (~> 0.19.0)
opentelemetry-registry (0.2.0)
opentelemetry-api (~> 1.1)
opentelemetry-resource_detectors (0.19.1)
google-cloud-env
opentelemetry-sdk
opentelemetry-sdk (1.2.0)
opentelemetry-api (~> 1.1)
opentelemetry-common (~> 0.19.3)
opentelemetry-registry (~> 0.2)
opentelemetry-semantic_conventions
opentelemetry-semantic_conventions (1.8.0)
opentelemetry-api (~> 1.0)
os (1.1.4)
parallel (1.22.1)
parser (3.2.0.0)
ast (~> 2.4.1)
pickup (0.0.11)
prometheus-client (2.1.0)
pry (0.14.2-java)
coderay (~> 1.1)
method_source (~> 1.0)
spoon (~> 0.0)
public_suffix (5.0.1)
puma (5.6.5-java)
nio4r (~> 2.0)
rack (2.2.6.2)
rack-protection (2.2.4)
rack
rack-test (2.0.2)
rack (>= 1.3)
rainbow (3.1.1)
rake (13.0.6)
redis (4.8.0)
regexp_parser (2.6.2)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.5)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.0)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubocop (1.1.0)
parallel (~> 1.10)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8)
rexml
rubocop-ast (>= 1.0.1)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.24.1)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
signet (0.17.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sinatra (2.2.4)
mustermann (~> 2.0)
rack (~> 2.2)
rack-protection (= 2.2.4)
tilt (~> 2.0)
spicy-proton (2.1.15)
bindata (~> 2.3)
spoon (0.0.6)
ffi
statsd-ruby (1.5.0)
thor (1.2.1)
thrift (0.17.0)
tilt (2.0.11)
trailblazer-option (0.1.2)
uber (0.1.0)
unicode-display_width (1.8.0)
vmpooler (2.4.0)
concurrent-ruby (~> 1.1)
connection_pool (~> 2.2)
deep_merge (~> 1.2)
net-ldap (~> 0.16)
opentelemetry-exporter-jaeger (= 0.20.1)
opentelemetry-instrumentation-concurrent_ruby (= 0.19.2)
opentelemetry-instrumentation-http_client (= 0.19.4)
opentelemetry-instrumentation-redis (= 0.21.3)
opentelemetry-instrumentation-sinatra (= 0.19.3)
opentelemetry-resource_detectors (= 0.19.1)
opentelemetry-sdk (~> 1.0, >= 1.0.2)
pickup (~> 0.0.11)
prometheus-client (~> 2.0)
puma (~> 5.0, >= 5.0.4)
rack (~> 2.2)
rake (~> 13.0)
redis (~> 4.1)
sinatra (~> 2.0)
spicy-proton (~> 2.1)
statsd-ruby (~> 1.4)
webrick (1.8.1)
yarjuf (2.0.0)
builder
rspec (~> 3)
zonefile (1.06)
PLATFORMS
universal-java-1.8
universal-java-11
DEPENDENCIES
climate_control (>= 0.2.0)
mock_redis (>= 0.17.0)
pry
rack-test (>= 0.6)
rspec (>= 3.2)
rubocop (~> 1.1.0)
simplecov (>= 0.11.2)
thor (~> 1.0, >= 1.0.1)
vmpooler-provider-gce!
yarjuf (>= 2.0)
BUNDLED WITH
2.4.5

View file

@ -1,5 +1,14 @@
# vmpooler-provider-gce # vmpooler-provider-gce
- [vmpooler-provider-gce](#vmpooler-provider-gce)
- [Usage](#usage)
- [DNS](#dns)
- [Labels](#labels)
- [Pre-requisite](#pre-requisite)
- [Update the Gemfile Lock](#update-the-gemfile-lock)
- [Releasing](#releasing)
- [License](#license)
This is a provider for [VMPooler](https://github.com/puppetlabs/vmpooler) allows using GCE to create instances, disks, This is a provider for [VMPooler](https://github.com/puppetlabs/vmpooler) allows using GCE to create instances, disks,
snapshots, or destroy instances for specific pools. snapshots, or destroy instances for specific pools.
@ -37,6 +46,21 @@ do not have the pool label, and can be configured to allow a specific list of un
- The service account needs to be given permissions to the project (broad permissions would be compute v1 admin and dns admin). A yaml file is provided that lists the least-privilege permissions needed - The service account needs to be given permissions to the project (broad permissions would be compute v1 admin and dns admin). A yaml file is provided that lists the least-privilege permissions needed
- if using DNS, a DNS zone needs to be created in CloudDNS, and configured in the provider's config section with the name of that zone (dns_zone_resource_name). When not specified, the DNS setup and teardown is skipped. - if using DNS, a DNS zone needs to be created in CloudDNS, and configured in the provider's config section with the name of that zone (dns_zone_resource_name). When not specified, the DNS setup and teardown is skipped.
## Update the Gemfile Lock
To update the `Gemfile.lock` run `./update-gemfile-lock`.
Verify, and update if needed, that the docker tag in the script and GitHub action workflows matches what is used in the [vmpooler-deployment Dockerfile](https://github.com/puppetlabs/vmpooler-deployment/blob/main/docker/Dockerfile).
## Releasing
Follow these steps to publish a new GitHub release, and build and push the gem to <https://rubygems.org>.
1. Bump the "VERSION" in `lib/vmpooler-provider-gce/version.rb` appropriately based on changes in `CHANGELOG.md` since the last release.
2. Run `./update-gemfile-lock` to update `Gemfile.lock`.
3. Run `./update-changelog` to update `CHANGELOG.md`.
4. Commit and push changes to a new branch, then open a pull request against `main` and be sure to add the "maintenance" label.
5. After the pull request is approved and merged, then navigate to Actions --> Release Gem --> run workflow --> Branch: main --> Run workflow.
## License ## License

5
update-changelog Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
docker run -it --rm -e CHANGELOG_GITHUB_TOKEN -v $(pwd):/usr/local/src/your-app \
githubchangeloggenerator/github-changelog-generator:1.16.2 \
github_changelog_generator --future-release $(grep VERSION lib/vmpooler-provider-gce/version.rb |rev |cut -d "'" -f2 |rev)

7
update-gemfile-lock Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# The container tag should closely match what is used in `docker/Dockerfile` in vmpooler-deployment
docker run -it --rm \
-v $(pwd):/app \
jruby:9.3.6-jdk \
/bin/bash -c 'apt-get update -qq && apt-get install -y --no-install-recommends make git && cd /app && gem install bundler && bundle install --jobs 3 && bundle update; echo "LOCK_FILE_UPDATE_EXIT_CODE=$?"'

View file

@ -18,8 +18,7 @@ Gem::Specification.new do |s|
s.add_dependency "google-apis-compute_v1", "~> 0.14" s.add_dependency "google-apis-compute_v1", "~> 0.14"
s.add_dependency "googleauth", ">= 0.16.2", "< 1.3.0" s.add_dependency "googleauth", ">= 0.16.2", "< 1.3.0"
s.add_dependency "google-cloud-dns", "~> 0.35.1" s.add_dependency "google-cloud-dns", "~> 0.35.1"
s.add_dependency 'vmpooler', '>= 1.3.0', '~> 2.3'
s.add_development_dependency 'vmpooler', '>= 1.3.0', '~> 2.3'
# Testing dependencies # Testing dependencies
s.add_development_dependency 'climate_control', '>= 0.2.0' s.add_development_dependency 'climate_control', '>= 0.2.0'