From 4ab4d511f70b38bb3bb6180855e1d00e99f3aaf9 Mon Sep 17 00:00:00 2001 From: Jake Spain Date: Mon, 20 Mar 2023 14:58:31 -0400 Subject: [PATCH] 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)