From e65a1dad3b08e34d22f1219998a1b11f172994aa Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Mon, 20 Mar 2023 14:11:04 -0400 Subject: [PATCH 1/7] Update test workflow names, action tags, and add ruby 3.2 --- .github/workflows/{ci.yml => test.yml} | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) rename .github/workflows/{ci.yml => test.yml} (85%) diff --git a/.github/workflows/ci.yml b/.github/workflows/test.yml similarity index 85% rename from .github/workflows/ci.yml rename to .github/workflows/test.yml index eadf380..4b9576f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby -name: CI +name: Test on: pull_request: @@ -13,8 +13,7 @@ on: - main jobs: - test: - + spec: runs-on: ubuntu-latest strategy: matrix: @@ -22,9 +21,10 @@ jobs: - '2.7' - '3.0' - '3.1' + - '3.2' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Ruby # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, # change this to (see https://github.com/ruby/setup-ruby#versioning): @@ -36,18 +36,19 @@ jobs: - name: Run tests run: bundle exec rake spec - name: Coveralls - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} flag-name: run-${{ matrix.ruby-version }} parallel: true finish: - needs: test + needs: spec + if: ${{ always() }} runs-on: ubuntu-latest steps: - name: Coveralls Finished - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.github_token }} - parallel-finished: true \ No newline at end of file + parallel-finished: true From d50e903167d94178824e798321d7d7c058c137de Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Mon, 20 Mar 2023 14:15:39 -0400 Subject: [PATCH 2/7] Dependabot scan for actions updates --- .github/dependabot.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 81e0069..1afdd73 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,13 @@ version: 2 updates: -- package-ecosystem: bundler - directory: "/" - schedule: - interval: weekly - open-pull-requests-limit: 10 + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + + - package-ecosystem: bundler + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 From dba1215db4cb8267607acd9a7b4da0ffcb6c48a6 Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Mon, 20 Mar 2023 14:33:15 -0400 Subject: [PATCH 3/7] Use Dockerfile for publishing an image --- .dockerignore | 3 --- Dockerfile | 25 +++++++++++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.dockerignore b/.dockerignore index 6174523..eaf3712 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,10 +3,7 @@ **/*.md **/*example **/Dockerfile* -Gemfile.lock -Rakefile coverage -spec examples scripts vendor diff --git a/Dockerfile b/Dockerfile index a38235d..700e7bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,23 @@ -FROM ruby:3.1.1-slim-buster +FROM ruby:3.1.3-slim-bullseye -COPY ./ ./ +LABEL org.opencontainers.image.authors="@puppetlabs/release-engineering" +LABEL org.opencontainers.image.title="vmfloaty" +LABEL org.opencontainers.image.source=https://github.com/puppetlabs/vmfloaty +LABEL org.opencontainers.image.description="A CLI helper tool for VMPooler" -RUN apt-get update && apt-get install -y less -RUN gem install bundler && bundle install && gem build vmfloaty.gemspec && gem install vmfloaty*.gem +RUN apt-get update -qq && apt-get install -y build-essential less make openssh-client + +RUN groupadd --gid 1000 floatygroup \ + && useradd --uid 1000 --gid 1000 -m floatyuser + +USER floatyuser + +WORKDIR /home/floatyuser/app +COPY --chown=floatyuser:floatygroup . . + +RUN gem install bundler \ + && bundle install \ + && gem build vmfloaty.gemspec \ + && gem install vmfloaty*.gem + +ENTRYPOINT [ "floaty" ] From 9fdbb4acb9a8b94b1590f6db5d6d92c0488464e4 Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Mon, 20 Mar 2023 14:35:42 -0400 Subject: [PATCH 4/7] Update workflow to check changelog, add release notes and docker push --- .github/workflows/release.yml | 98 +++++++++++++++++++++++++++++++---- 1 file changed, 87 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 273a263..39b43e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,32 +1,108 @@ -name: Release +name: Tag Release & Push Gem & Docker on: workflow_dispatch +permissions: + contents: write + issues: read + pull-requests: read + packages: write + jobs: release: - name: Build + Publish + name: Validate Docs, Tag, and Docker Push runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Get Version - id: gv - run: | - echo "::set-output name=ver::$(grep VERSION lib/vmfloaty/version.rb |rev |cut -d "'" -f2 |rev)" + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + clean: true + fetch-depth: 0 + + - name: Get New Version + id: nv + run: | + version=$(grep VERSION lib/vmfloaty/version.rb |rev |cut -d "'" -f2 |rev) + echo "version=$version" >> $GITHUB_OUTPUT + echo "Found version $version from lib/vmfloaty/version.rb" + + - 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: 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 output=$(git status --porcelain) && [ ! -z "$output" ]; 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 './release-prep ${{ steps.nv.outputs.version }}'" + 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 uses: ncipollo/release-action@v1 with: - tag: ${{ steps.gv.outputs.ver }} + tag: ${{ steps.nv.outputs.version }} token: ${{ secrets.GITHUB_TOKEN }} + bodyfile: release-notes.md draft: false prerelease: false - generateReleaseNotes: true - - name: Set up Ruby 2.7 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + tags: | + ghcr.io/${{ github.repository }}:${{ steps.nv.outputs.version }} + ghcr.io/${{ github.repository }}:latest + + - name: Set up Ruby 3.2 uses: actions/setup-ruby@v1 with: - version: 2.7.x + version: 3.2.x - name: Build gem run: gem build *.gemspec From 68843c1ecf0acfa29a64e99ba187df96e36504fe Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Mon, 20 Mar 2023 14:35:54 -0400 Subject: [PATCH 5/7] Add changelog --- .github_changelog_generator | 3 + CHANGELOG.md | 312 ++++++++++++++++++++++++++++++++++++ 2 files changed, 315 insertions(+) create mode 100644 .github_changelog_generator create mode 100644 CHANGELOG.md diff --git a/.github_changelog_generator b/.github_changelog_generator new file mode 100644 index 0000000..02a0c7c --- /dev/null +++ b/.github_changelog_generator @@ -0,0 +1,3 @@ +project=vmfloaty +user=puppetlabs +exclude_labels=maintenance diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..fa063ee --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,312 @@ +# Changelog + +## [Unreleased](https://github.com/puppetlabs/vmfloaty/tree/HEAD) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/1.7.0...HEAD) + +**Merged pull requests:** + +- \(RE-15111\) Migrate Synk to Mend [\#168](https://github.com/puppetlabs/vmfloaty/pull/168) ([yachub](https://github.com/yachub)) +- \(RE-14811\) Move codeowners from DIO to RE [\#165](https://github.com/puppetlabs/vmfloaty/pull/165) ([yachub](https://github.com/yachub)) +- Add Snyk action and Move to RE org [\#164](https://github.com/puppetlabs/vmfloaty/pull/164) ([yachub](https://github.com/yachub)) +- Add release-engineering to codeowners [\#163](https://github.com/puppetlabs/vmfloaty/pull/163) ([yachub](https://github.com/yachub)) + +## [1.7.0](https://github.com/puppetlabs/vmfloaty/tree/1.7.0) (2022-04-05) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v1.6.0...1.7.0) + +**Implemented enhancements:** + +- \(maint\) Add Ruby 3.1 to test matrix + dockerfile and drop EOL Ruby 2.6 [\#159](https://github.com/puppetlabs/vmfloaty/pull/159) ([yachub](https://github.com/yachub)) +- \(DIO-3101\) Add VMPooler API v2 Support [\#158](https://github.com/puppetlabs/vmfloaty/pull/158) ([yachub](https://github.com/yachub)) + +**Fixed bugs:** + +- \(maint\) Remove colorize usage from `floaty status` [\#160](https://github.com/puppetlabs/vmfloaty/pull/160) ([yachub](https://github.com/yachub)) + +**Merged pull requests:** + +- v1.7.0 release prep [\#162](https://github.com/puppetlabs/vmfloaty/pull/162) ([yachub](https://github.com/yachub)) +- \(maint\) removing previous maintainers [\#157](https://github.com/puppetlabs/vmfloaty/pull/157) ([binford2k](https://github.com/binford2k)) +- Update rspec requirement from ~\> 3.10.0 to ~\> 3.11.0 [\#155](https://github.com/puppetlabs/vmfloaty/pull/155) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Docs on contributing and releasing [\#152](https://github.com/puppetlabs/vmfloaty/pull/152) ([genebean](https://github.com/genebean)) + +## [v1.6.0](https://github.com/puppetlabs/vmfloaty/tree/v1.6.0) (2022-02-16) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v1.5.0...v1.6.0) + +**Merged pull requests:** + +- \(DIO-2700\) Vmfloaty should not use the Colorize gem [\#156](https://github.com/puppetlabs/vmfloaty/pull/156) ([sbeaulie](https://github.com/sbeaulie)) +- \(maint\) Fix up nspooler list active bug [\#154](https://github.com/puppetlabs/vmfloaty/pull/154) ([cthorn42](https://github.com/cthorn42)) +- Minor cleanup to the readme [\#151](https://github.com/puppetlabs/vmfloaty/pull/151) ([genebean](https://github.com/genebean)) +- Release prep for 1.5.0 [\#150](https://github.com/puppetlabs/vmfloaty/pull/150) ([genebean](https://github.com/genebean)) + +## [v1.5.0](https://github.com/puppetlabs/vmfloaty/tree/v1.5.0) (2021-10-12) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v1.4.0...v1.5.0) + +**Merged pull requests:** + +- DIO 2412- Ondemand and Priority flag added to SSH command [\#149](https://github.com/puppetlabs/vmfloaty/pull/149) ([tanisha-payne](https://github.com/tanisha-payne)) +- \(DIO-2135\) Update docker FROM image to ruby 3.0.2 [\#148](https://github.com/puppetlabs/vmfloaty/pull/148) ([sbeaulie](https://github.com/sbeaulie)) +- Migrate CI to GitHub Actions [\#147](https://github.com/puppetlabs/vmfloaty/pull/147) ([genebean](https://github.com/genebean)) +- v1.4.0 release prep [\#146](https://github.com/puppetlabs/vmfloaty/pull/146) ([genebean](https://github.com/genebean)) + +## [v1.4.0](https://github.com/puppetlabs/vmfloaty/tree/v1.4.0) (2021-07-16) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v1.3.0...v1.4.0) + +**Merged pull requests:** + +- \(maint\) Use latest Faraday/webmock, update specs [\#145](https://github.com/puppetlabs/vmfloaty/pull/145) ([nmburgan](https://github.com/nmburgan)) +- Update commander requirement from \>= 4.4.3, \< 4.6.0 to \>= 4.4.3, \< 4.7.0 [\#140](https://github.com/puppetlabs/vmfloaty/pull/140) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Release prep for v1.3.0 [\#137](https://github.com/puppetlabs/vmfloaty/pull/137) ([sbeaulie](https://github.com/sbeaulie)) +- Run the rubocop auto\_correct [\#135](https://github.com/puppetlabs/vmfloaty/pull/135) ([sbeaulie](https://github.com/sbeaulie)) + +## [v1.3.0](https://github.com/puppetlabs/vmfloaty/tree/v1.3.0) (2021-03-03) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v1.2.0...v1.3.0) + +**Merged pull requests:** + +- \(DIO-1522\) Show the VM state \(running, destroyed\) and colorize in red… [\#134](https://github.com/puppetlabs/vmfloaty/pull/134) ([sbeaulie](https://github.com/sbeaulie)) +- Release prep for 1.2.0 [\#132](https://github.com/puppetlabs/vmfloaty/pull/132) ([genebean](https://github.com/genebean)) +- Update rubocop requirement from ~\> 0.52 to ~\> 1.6 [\#124](https://github.com/puppetlabs/vmfloaty/pull/124) ([dependabot[bot]](https://github.com/apps/dependabot)) + +## [v1.2.0](https://github.com/puppetlabs/vmfloaty/tree/v1.2.0) (2021-02-11) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v1.1.1...v1.2.0) + +**Merged pull requests:** + +- \(DIO-908\) Floaty can now report the status of ABS requests [\#131](https://github.com/puppetlabs/vmfloaty/pull/131) ([sbeaulie](https://github.com/sbeaulie)) +- Update rspec requirement from ~\> 3.9.0 to ~\> 3.10.0 [\#116](https://github.com/puppetlabs/vmfloaty/pull/116) ([dependabot[bot]](https://github.com/apps/dependabot)) + +## [v1.1.1](https://github.com/puppetlabs/vmfloaty/tree/v1.1.1) (2020-10-16) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v1.1.0...v1.1.1) + +**Merged pull requests:** + +- V1.1.1 [\#112](https://github.com/puppetlabs/vmfloaty/pull/112) ([sbeaulie](https://github.com/sbeaulie)) + +## [v1.1.0](https://github.com/puppetlabs/vmfloaty/tree/v1.1.0) (2020-10-09) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v1.0.0...v1.1.0) + +**Merged pull requests:** + +- \(maint\) Add more uniqueness to jobid and useful termination message [\#107](https://github.com/puppetlabs/vmfloaty/pull/107) ([sbeaulie](https://github.com/sbeaulie)) +- \(maint\) Fix bug with detecting ABS service [\#106](https://github.com/puppetlabs/vmfloaty/pull/106) ([sbeaulie](https://github.com/sbeaulie)) +- \(maint\) Don't require config file for list --active [\#105](https://github.com/puppetlabs/vmfloaty/pull/105) ([sbeaulie](https://github.com/sbeaulie)) +- \(maint\) Don't require configuration file for get [\#104](https://github.com/puppetlabs/vmfloaty/pull/104) ([nwolfe](https://github.com/nwolfe)) +- \(maint\) Add vmpooler\_fallback to the get service check [\#103](https://github.com/puppetlabs/vmfloaty/pull/103) ([cthorn42](https://github.com/cthorn42)) +- Update completion scripts for `service` subcommands [\#102](https://github.com/puppetlabs/vmfloaty/pull/102) ([scotje](https://github.com/scotje)) +- Bump to version 1.0.0 [\#100](https://github.com/puppetlabs/vmfloaty/pull/100) ([genebean](https://github.com/genebean)) + +## [v1.0.0](https://github.com/puppetlabs/vmfloaty/tree/v1.0.0) (2020-09-22) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/0.11.1...v1.0.0) + +**Merged pull requests:** + +- \(maint\) Fix for ABS PR\#306 that includes json responses [\#99](https://github.com/puppetlabs/vmfloaty/pull/99) ([sbeaulie](https://github.com/sbeaulie)) +- \(maint\) Support any vmpooler for ABS via vmpooler\_fallback [\#98](https://github.com/puppetlabs/vmfloaty/pull/98) ([sbeaulie](https://github.com/sbeaulie)) +- \(DIO-991\) Add service command [\#97](https://github.com/puppetlabs/vmfloaty/pull/97) ([genebean](https://github.com/genebean)) +- \( DIO-911\) Include job\_id in ABS --json output [\#96](https://github.com/puppetlabs/vmfloaty/pull/96) ([sbeaulie](https://github.com/sbeaulie)) +- ABS enables fallback to vmpooler for some scenarios [\#94](https://github.com/puppetlabs/vmfloaty/pull/94) ([sbeaulie](https://github.com/sbeaulie)) +- WIP \(DIO-911\) Include job\_id in ABS --json output [\#92](https://github.com/puppetlabs/vmfloaty/pull/92) ([nwolfe](https://github.com/nwolfe)) +- \(maint\) Remove warning about missing configuration file [\#91](https://github.com/puppetlabs/vmfloaty/pull/91) ([nwolfe](https://github.com/nwolfe)) +- Add tab completion script for zsh and fix bash completion for ABS services [\#90](https://github.com/puppetlabs/vmfloaty/pull/90) ([scotje](https://github.com/scotje)) + +## [0.11.1](https://github.com/puppetlabs/vmfloaty/tree/0.11.1) (2020-08-20) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/0.10.0...0.11.1) + +**Merged pull requests:** + +- Update version for 0.11.1 release [\#89](https://github.com/puppetlabs/vmfloaty/pull/89) ([mattkirby](https://github.com/mattkirby)) +- \(maint\) Fix using ABS service without a .vmfloaty.yml file [\#88](https://github.com/puppetlabs/vmfloaty/pull/88) ([cthorn42](https://github.com/cthorn42)) +- Fix the argument list for nonstandardpooler [\#87](https://github.com/puppetlabs/vmfloaty/pull/87) ([jarretlavallee](https://github.com/jarretlavallee)) +- Json output for delete/list + better ABS error handling [\#86](https://github.com/puppetlabs/vmfloaty/pull/86) ([mcdonaldseanp](https://github.com/mcdonaldseanp)) +- Bump version for 0.11.0 release [\#85](https://github.com/puppetlabs/vmfloaty/pull/85) ([mattkirby](https://github.com/mattkirby)) +- Print all non-success output to STDERR [\#84](https://github.com/puppetlabs/vmfloaty/pull/84) ([austb](https://github.com/austb)) +- Update travis.yml [\#83](https://github.com/puppetlabs/vmfloaty/pull/83) ([rooneyshuman](https://github.com/rooneyshuman)) +- Bump version to 0.10.0 for release [\#82](https://github.com/puppetlabs/vmfloaty/pull/82) ([mattkirby](https://github.com/mattkirby)) + +## [0.10.0](https://github.com/puppetlabs/vmfloaty/tree/0.10.0) (2020-08-04) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.9.2-retag-for-gh-actions-for-real...0.10.0) + +**Merged pull requests:** + +- Update Dependabot config file [\#78](https://github.com/puppetlabs/vmfloaty/pull/78) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) +- Update rspec requirement from ~\> 3.5.0 to ~\> 3.9.0 [\#75](https://github.com/puppetlabs/vmfloaty/pull/75) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) +- Update commander requirement from ~\> 4.4.3 to \>= 4.4.3, \< 4.6.0 [\#73](https://github.com/puppetlabs/vmfloaty/pull/73) ([dependabot-preview[bot]](https://github.com/apps/dependabot-preview)) +- Fix formatting of CODEOWNERS [\#71](https://github.com/puppetlabs/vmfloaty/pull/71) ([genebean](https://github.com/genebean)) +- Add Dependabot and Coveralls [\#70](https://github.com/puppetlabs/vmfloaty/pull/70) ([genebean](https://github.com/genebean)) +- Update docs [\#69](https://github.com/puppetlabs/vmfloaty/pull/69) ([genebean](https://github.com/genebean)) +- Remove old maintainer note [\#68](https://github.com/puppetlabs/vmfloaty/pull/68) ([briancain](https://github.com/briancain)) +- Add support for vmpooler on demand provisioning [\#67](https://github.com/puppetlabs/vmfloaty/pull/67) ([mattkirby](https://github.com/mattkirby)) + +## [v0.9.2-retag-for-gh-actions-for-real](https://github.com/puppetlabs/vmfloaty/tree/v0.9.2-retag-for-gh-actions-for-real) (2020-02-05) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.9.2...v0.9.2-retag-for-gh-actions-for-real) + +**Merged pull requests:** + +- Update gempush action to remove GPR publish [\#66](https://github.com/puppetlabs/vmfloaty/pull/66) ([highb](https://github.com/highb)) + +## [v0.9.2](https://github.com/puppetlabs/vmfloaty/tree/v0.9.2) (2020-02-05) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.9.2-retag-for-gh-actions...v0.9.2) + +## [v0.9.2-retag-for-gh-actions](https://github.com/puppetlabs/vmfloaty/tree/v0.9.2-retag-for-gh-actions) (2020-02-05) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.9.0...v0.9.2-retag-for-gh-actions) + +**Merged pull requests:** + +- Bump version.rb to 0.9.2 for release [\#65](https://github.com/puppetlabs/vmfloaty/pull/65) ([highb](https://github.com/highb)) +- Create gempush.yml Github Action [\#64](https://github.com/puppetlabs/vmfloaty/pull/64) ([highb](https://github.com/highb)) +- Bump faraday dependency for Ruby 2.7 compatibility [\#62](https://github.com/puppetlabs/vmfloaty/pull/62) ([nicklewis](https://github.com/nicklewis)) +- SSH Command respects ABS now and tests should fail if the API changes… [\#61](https://github.com/puppetlabs/vmfloaty/pull/61) ([mikkergimenez](https://github.com/mikkergimenez)) +- \(QENG-7604\) Add support for Job IDs to ABS delete [\#60](https://github.com/puppetlabs/vmfloaty/pull/60) ([highb](https://github.com/highb)) +- Bump version.rb to 0.9.1 [\#59](https://github.com/puppetlabs/vmfloaty/pull/59) ([highb](https://github.com/highb)) +- Fix error with delete command for vmpooler and nspooler [\#58](https://github.com/puppetlabs/vmfloaty/pull/58) ([mikkergimenez](https://github.com/mikkergimenez)) + +## [v0.9.0](https://github.com/puppetlabs/vmfloaty/tree/v0.9.0) (2019-12-17) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.8.2...v0.9.0) + +**Implemented enhancements:** + +- Add abs vm get [\#53](https://github.com/puppetlabs/vmfloaty/pull/53) ([mikkergimenez](https://github.com/mikkergimenez)) + +**Fixed bugs:** + +- vmfloaty reports an error on latest API version output [\#48](https://github.com/puppetlabs/vmfloaty/issues/48) + +**Merged pull requests:** + +- ABS will sometimes return null values in the /status/queue endpoint [\#57](https://github.com/puppetlabs/vmfloaty/pull/57) ([mikkergimenez](https://github.com/mikkergimenez)) +- Minor version bump to 0.9.0 [\#56](https://github.com/puppetlabs/vmfloaty/pull/56) ([highb](https://github.com/highb)) +- Update pooler provider to throw an exception if the API returns non-OK [\#55](https://github.com/puppetlabs/vmfloaty/pull/55) ([highb](https://github.com/highb)) +- Update Faraday to 0.15, remove unnecessary headers [\#54](https://github.com/puppetlabs/vmfloaty/pull/54) ([highb](https://github.com/highb)) +- change urls in docs to use example.net/.com [\#50](https://github.com/puppetlabs/vmfloaty/pull/50) ([steveax](https://github.com/steveax)) +- Rubocop cleanup [\#49](https://github.com/puppetlabs/vmfloaty/pull/49) ([rodjek](https://github.com/rodjek)) + +## [v0.8.2](https://github.com/puppetlabs/vmfloaty/tree/v0.8.2) (2018-01-05) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.8.1...v0.8.2) + +**Merged pull requests:** + +- 🎂🎂🎂 Add --json option for `floaty get` [\#47](https://github.com/puppetlabs/vmfloaty/pull/47) ([nicklewis](https://github.com/nicklewis)) + +## [v0.8.1](https://github.com/puppetlabs/vmfloaty/tree/v0.8.1) (2017-10-24) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.8.0...v0.8.1) + +**Merged pull requests:** + +- Bump commander version to clear up deprecation warnings [\#46](https://github.com/puppetlabs/vmfloaty/pull/46) ([highb](https://github.com/highb)) + +## [v0.8.0](https://github.com/puppetlabs/vmfloaty/tree/v0.8.0) (2017-10-13) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.7.9...v0.8.0) + +**Closed issues:** + +- don't automatically call system pager for help screens [\#20](https://github.com/puppetlabs/vmfloaty/issues/20) + +**Merged pull requests:** + +- Add configuration for multiple pooler services and integration with nspooler [\#45](https://github.com/puppetlabs/vmfloaty/pull/45) ([caseywilliams](https://github.com/caseywilliams)) + +## [v0.7.9](https://github.com/puppetlabs/vmfloaty/tree/v0.7.9) (2017-07-31) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.7.8...v0.7.9) + +**Closed issues:** + +- Handle when vmfloaty cannot reach vmpooler [\#39](https://github.com/puppetlabs/vmfloaty/issues/39) + +**Merged pull requests:** + +- Add basic bash completion script and framework for others [\#44](https://github.com/puppetlabs/vmfloaty/pull/44) ([scotje](https://github.com/scotje)) +- Developersdevelopersdevelopers [\#43](https://github.com/puppetlabs/vmfloaty/pull/43) ([mckern](https://github.com/mckern)) + +## [v0.7.8](https://github.com/puppetlabs/vmfloaty/tree/v0.7.8) (2016-12-20) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.7.7...v0.7.8) + +## [v0.7.7](https://github.com/puppetlabs/vmfloaty/tree/v0.7.7) (2016-12-14) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.7.6...v0.7.7) + +## [v0.7.6](https://github.com/puppetlabs/vmfloaty/tree/v0.7.6) (2016-12-09) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/v0.7.5...v0.7.6) + +**Closed issues:** + +- Improve the help text for floaty commands [\#41](https://github.com/puppetlabs/vmfloaty/issues/41) +- Require force flag for pool requests larger than 5? [\#40](https://github.com/puppetlabs/vmfloaty/issues/40) + +## [v0.7.5](https://github.com/puppetlabs/vmfloaty/tree/v0.7.5) (2016-12-06) + +[Full Changelog](https://github.com/puppetlabs/vmfloaty/compare/1f86113243eb2e898b21c29892c05477e3487d2d...v0.7.5) + +**Implemented enhancements:** + +- Improve how to specify number of vms in get request [\#8](https://github.com/puppetlabs/vmfloaty/issues/8) +- Improve output from commands [\#3](https://github.com/puppetlabs/vmfloaty/issues/3) + +**Fixed bugs:** + +- floaty snapshot fails to authenticate [\#4](https://github.com/puppetlabs/vmfloaty/issues/4) + +**Closed issues:** + +- floaty snapshot should warn users about how long it takes to get snapshot [\#37](https://github.com/puppetlabs/vmfloaty/issues/37) +- floaty modify should allow to make changes on more than one machine [\#36](https://github.com/puppetlabs/vmfloaty/issues/36) +- Pooler.modify raises exception if Token is nil [\#34](https://github.com/puppetlabs/vmfloaty/issues/34) +- Improve error handling in Pooler and Auth classes [\#33](https://github.com/puppetlabs/vmfloaty/issues/33) +- Handle vmpooler responses when token is invalid in Pooler class [\#32](https://github.com/puppetlabs/vmfloaty/issues/32) +- Misuse of 'floaty revert ...' seems to create a new snapshot [\#31](https://github.com/puppetlabs/vmfloaty/issues/31) +- Test [\#30](https://github.com/puppetlabs/vmfloaty/issues/30) +- Don't system exit in Auth class [\#29](https://github.com/puppetlabs/vmfloaty/issues/29) +- Add flag to auto-ssh into a newly created \(single\) VM [\#28](https://github.com/puppetlabs/vmfloaty/issues/28) +- Handle vmpooler URL key that doesn't have 'https' [\#27](https://github.com/puppetlabs/vmfloaty/issues/27) +- Abstract vmfloaty cli related errors to command class rather than pooler class [\#26](https://github.com/puppetlabs/vmfloaty/issues/26) +- Don't puts results in `delete` method in Pooler library [\#25](https://github.com/puppetlabs/vmfloaty/issues/25) +- Improve `get` output [\#24](https://github.com/puppetlabs/vmfloaty/issues/24) +- specs don't work [\#22](https://github.com/puppetlabs/vmfloaty/issues/22) +- Add ability to get additional disk space for a running vm [\#19](https://github.com/puppetlabs/vmfloaty/issues/19) +- Have a force option for `delete --all` [\#17](https://github.com/puppetlabs/vmfloaty/issues/17) +- Stop printing json response in library methods [\#14](https://github.com/puppetlabs/vmfloaty/issues/14) +- Stop system exiting in library methods [\#13](https://github.com/puppetlabs/vmfloaty/issues/13) +- List active vms for a given token [\#12](https://github.com/puppetlabs/vmfloaty/issues/12) +- Provide a way to clean up vms obtained by a token [\#11](https://github.com/puppetlabs/vmfloaty/issues/11) +- Allow spaces when passing in vms for commands [\#10](https://github.com/puppetlabs/vmfloaty/issues/10) +- Write Tests for Pooler class [\#9](https://github.com/puppetlabs/vmfloaty/issues/9) +- Document all valid config file keys [\#7](https://github.com/puppetlabs/vmfloaty/issues/7) +- Write up simple "introduction" to using the tool [\#6](https://github.com/puppetlabs/vmfloaty/issues/6) +- Document how to use Pooler class for ruby scripts [\#5](https://github.com/puppetlabs/vmfloaty/issues/5) +- Convert vmfloaty to use latest pooler API [\#1](https://github.com/puppetlabs/vmfloaty/issues/1) + +**Merged pull requests:** + +- Show the status of pools with `floaty status` [\#38](https://github.com/puppetlabs/vmfloaty/pull/38) ([nicklewis](https://github.com/nicklewis)) +- Show tag values in `list --active` [\#23](https://github.com/puppetlabs/vmfloaty/pull/23) ([justinstoller](https://github.com/justinstoller)) +- \(\#19\) Update vmfloaty to expect /api/v1 in URL for disk endpoint [\#21](https://github.com/puppetlabs/vmfloaty/pull/21) ([briancain](https://github.com/briancain)) +- \(\#17\) Add a force option for delete --all [\#18](https://github.com/puppetlabs/vmfloaty/pull/18) ([briancain](https://github.com/briancain)) +- \(\#12\) List active vms for a given token [\#16](https://github.com/puppetlabs/vmfloaty/pull/16) ([briancain](https://github.com/briancain)) +- Cleanup vmfloaty library and command processor [\#15](https://github.com/puppetlabs/vmfloaty/pull/15) ([briancain](https://github.com/briancain)) +- \(\#1\) Update with commander [\#2](https://github.com/puppetlabs/vmfloaty/pull/2) ([briancain](https://github.com/briancain)) + + + +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* From 4ab4d511f70b38bb3bb6180855e1d00e99f3aaf9 Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Mon, 20 Mar 2023 14:58:31 -0400 Subject: [PATCH 6/7] Add release instructions and reference docker image --- README.md | 53 ++++++++++++++++++++++++++++++++-------------------- release-prep | 12 ++++++++++++ 2 files changed, 45 insertions(+), 20 deletions(-) create mode 100755 release-prep diff --git a/README.md b/README.md index 15ec356..2aa2d31 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,48 @@ # vmfloaty [![Gem Version](https://badge.fury.io/rb/vmfloaty.svg)](https://badge.fury.io/rb/vmfloaty) -[![CI](https://github.com/puppetlabs/vmfloaty/actions/workflows/ci.yml/badge.svg)](https://github.com/puppetlabs/vmfloaty/actions/workflows/ci.yml) +[![Test](https://github.com/puppetlabs/vmfloaty/actions/workflows/test.yml/badge.svg)](https://github.com/puppetlabs/vmfloaty/actions/workflows/test.yml) A CLI helper tool for [Puppet's VMPooler](https://github.com/puppetlabs/vmpooler) to help you stay afloat. ![float image](float.jpg) -- [Install](#install) -- [Usage](#usage) - - [Example workflow](#example-workflow) - - [vmfloaty dotfile](#vmfloaty-dotfile) - - [Basic configuration](#basic-configuration) - - [Using multiple services](#using-multiple-services) - - [Using backends besides VMPooler](#using-backends-besides-vmpooler) - - [Valid config keys](#valid-config-keys) - - [Tab Completion](#tab-completion) -- [VMPooler API](#vmpooler-api) -- [Using the Pooler class](#using-the-pooler-class) - - [Example Projects](#example-projects) -- [Contributing](#contributing) - - [Code Reviews](#code-reviews) -- [Releasing](#releasing) -- [Special thanks](#special-thanks) +- [vmfloaty](#vmfloaty) + - [Install](#install) + - [Ruby](#ruby) + - [Docker](#docker) + - [Usage](#usage) + - [Example workflow](#example-workflow) + - [vmfloaty dotfile](#vmfloaty-dotfile) + - [Basic configuration](#basic-configuration) + - [Using multiple services](#using-multiple-services) + - [Using backends besides VMPooler](#using-backends-besides-vmpooler) + - [Valid config keys](#valid-config-keys) + - [Tab Completion](#tab-completion) + - [VMPooler API](#vmpooler-api) + - [Using the Pooler class](#using-the-pooler-class) + - [Example Projects](#example-projects) + - [Contributing](#contributing) + - [Code Reviews](#code-reviews) + - [Releasing](#releasing) + - [Special thanks](#special-thanks) ## Install +### Ruby + Grab the latest from ruby gems... ```bash gem install vmfloaty ``` +### Docker + +Run the docker image: + +`docker run -it --rm -v ~/.vmfloaty.yml:/home/floatyuser/.vmfloaty.yml ghcr.io/puppetlabs/vmfloaty --help` + ## Usage ```plain @@ -177,10 +188,12 @@ Please wait for multiple code owners to sign off on any notable change. ## Releasing -Releasing is a two step process: +Follow these steps to publish a new GitHub release, build and push the gem to , and build and push a Docker Image to GitHub Container Registry: -1. Submit a release prep PR that updates `lib/vmfloaty/version.rb` to the desired new version and get that merged -2. Navigate to --> Run workflow --> select "main" branch --> Run workflow. This will publish a GitHub release, build, and push the gem to RubyGems. +1. Bump the "VERSION" in `lib/vmpooler/version.rb` appropriately based on changes in `CHANGELOG.md` since the last release. +2. Run `./release-prep` to update `Gemfile.lock` if necessary and `CHANGELOG.md`. +3. Commit and push changes to a new branch, then open a pull request against `main` and be sure to add the "maintenance" label. +4. After the pull request is approved and merged, then navigate to --> Run workflow --> select "main" branch --> Run workflow. This will publish a GitHub release, build and push the gem to RubyGems, and build and push a Docker Image to GitHub Container Registry. ## Special thanks diff --git a/release-prep b/release-prep new file mode 100755 index 0000000..d5bbb83 --- /dev/null +++ b/release-prep @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# bundle install +docker run -it --rm \ + -v $(pwd):/app \ + $(grep ^FROM ./Dockerfile |cut -d ' ' -f2) \ + /bin/bash -c 'apt-get update -qq && apt-get install -y --no-install-recommends build-essential make openssh-client && cd /app && gem install bundler && bundle install --jobs 3; echo "LOCK_FILE_UPDATE_EXIT_CODE=$?"' + +# Update Changelog +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/vmfloaty/version.rb |rev |cut -d "'" -f2 |rev) From 9b669f6acaf720b7c067a7f77a714b3b629d7ea0 Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Mon, 20 Mar 2023 15:20:21 -0400 Subject: [PATCH 7/7] Add Gemfile.lock --- .gitignore | 1 - Gemfile.lock | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index 1351382..76a21bc 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,6 @@ build/ # for a library or gem, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: -Gemfile.lock .ruby-version .ruby-gemset diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..45dfa5b --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,118 @@ +PATH + remote: . + specs: + vmfloaty (1.7.0) + commander (>= 4.4.3, < 4.7.0) + faraday (~> 1.5, >= 1.5.1) + +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + ast (2.4.2) + coderay (1.1.3) + commander (4.6.0) + highline (~> 2.0.0) + crack (0.4.5) + rexml + diff-lcs (1.5.0) + docile (1.4.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + hashdiff (1.0.1) + highline (2.0.3) + json (2.6.3) + method_source (1.0.0) + multipart-post (2.3.0) + parallel (1.22.1) + parser (3.2.1.1) + ast (~> 2.4.1) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (5.0.1) + rainbow (3.1.1) + rake (13.0.6) + rb-readline (0.5.5) + regexp_parser (2.7.0) + rexml (3.2.5) + rspec (3.11.0) + rspec-core (~> 3.11.0) + rspec-expectations (~> 3.11.0) + rspec-mocks (~> 3.11.0) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-mocks (3.11.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-support (3.11.1) + rubocop (1.48.1) + json (~> 2.3) + parallel (~> 1.10) + parser (>= 3.2.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.26.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.27.0) + parser (>= 3.2.1.0) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + simplecov (0.21.2) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.12.3) + simplecov-lcov (0.8.0) + simplecov_json_formatter (0.1.4) + unicode-display_width (2.4.2) + webmock (3.18.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + +PLATFORMS + aarch64-linux + x86_64-linux + +DEPENDENCIES + pry + rake + rb-readline + rspec (~> 3.11.0) + rubocop (~> 1.6) + simplecov (~> 0.21.2) + simplecov-html (~> 0.12.3) + simplecov-lcov (~> 0.8.0) + vmfloaty! + webmock (~> 3.13) + +BUNDLED WITH + 2.4.8