doki

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

README

Dōki

A companion tool to work with versioning and keeping in sync profiles and pctl.

Features

go mod

Dōki, wraps some go mod functionality for convenience and for usage in Makefiles.

latest

It provides a list of go get-able urls for a list of modules, by adding the latest available tag to that module.

Example:

doki go mod latest github.com/weaveworks/pctl github.com/weaveworks/profiles
github.com/weaveworks/pctl@v0.0.3
github.com/weaveworks/profiles@v0.0.5

This output is best consumed by a make target such as:

.PHONY: update-modules
	go get \
		$(shell doki mod latest \
			github.com/weaveworks/profiles \
			github.com/weaveworks/pctl \
			<whatever> \
		)
	go mod tidy

Calling this make target will result in the latest pins in go.mod file to the list of these modules.

replace

Similar to latest, it provides a list of replace statements for modules.

Example:

doki go mod replace --replacements github.com/weaveworks/pctl=github.com/weaveworks/pctl@specific-version,github.com/weaveworks/profiles=github.com/weaveworks/profiles@specific-version
-replace github.com/weaveworks/pctl@<specific-version> -replace github.com/weaveworks/profiles@<specific-version>

This output is best consumed by another make target, or the same update-modules target as above to make sure all the modules always have the correct replacements.

.PHONY: update-modules
	go mod edit \
   		$(shell doki mod replacements)
	go get \
		$(shell doki mod latest \
			github.com/weaveworks/profiles \
			github.com/weaveworks/pctl \
			<whatever> \
		)
	go mod tidy

Note that we don't provide replace argument here. The replacements could come from a global replacements map definition. To have replacements in all products across multiple repos to the same thing using this single tool.

dev tags

Convenient check to retrieve a dev tag for a branch.

Run:

➜  doki git:(my-new-branch) ✗ doki get dev tag
v0.0.1-my-new-branch

It will automatically fetch the latest released tag and append the branch to it. This is the format used by profiles. New commits push into existing tags, keeping them always up-to-date.

self update-check

This is a convenient function to check if your installation of Doki is up-to-date.

Optional Token

If Dōki is used to access a non-public repository, calls to determine the latest version might require a token. For that, it provides two options:

  • through DOKI_TOKEN
  • flag --token

Development

Running tests: make tests.

Releasing

There are some manual steps right now, should be streamlined soon.

Steps:

  1. Create a new release notes file:

    touch docs/release_notes/<version>.md
    
  2. Copy-and paste the release notes from the draft on the releases page into this file. Note: sometimes the release drafter is a bit of a pain, verify that the notes are correct by doing something like: git log --first-parent tag1..tag2.

  3. PR the release notes into main.

  4. Create and push a tag with the new version:

    git tag <version>
    git push origin <version>
    
  5. The Create release action should run. Verify that:

  6. The release has been created in GitHub

    1. With the correct assets
    2. With the correct release notes
  7. The image has been pushed to docker

  8. The image can be pulled and used in a deployment

Note that <version> must be in the following format: v0.0.1.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
git
git/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
runner/fakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL