jelease

command module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

README

jelease gopher logo

jelease - A newreleases.io ➡️ Jira connector

REUSE status

Automatically create Jira tickets when a newreleases.io release is detected using webhooks.

Configuration

Jelease is configured via YAML files. See jelease.yaml for the default values.

Configuration files

Jelease looks for config files in multiple locations, where the latter overrides config fields from the former.

On Linux:

  1. Default values (see jelease.yaml)
  2. /etc/jelease/jelease.yaml
  3. ~/.config/jelease.yaml
  4. ~/.jelease.yaml
  5. jelease.yaml (in current directory)

On Windows:

  1. Default values (see jelease.yaml)
  2. %APPDATA%/jelease.yaml
  3. %USERPROFILE%/.jelease.yaml
  4. jelease.yaml (in current directory)

On Mac:

  1. Default values (see jelease.yaml)
  2. /etc/jelease/jelease.yaml
  3. ~/Library/Application Support/jelease.yaml
  4. ~/.jelease.yaml
  5. jelease.yaml (in current directory)

JSON Schema

There's also a JSON Schema for the config file, which gives you warnings and completion support inside your IDE.

Make use of it via e.g:

To make use of it, add the following comment to the beginning of your config file:

# yaml-language-server: $schema=https://github.com/RiskIdent/jelease/raw/main/jelease.schema.json

Local usage

  1. Create a GitHub PAT (e.g on https://github.com/settings/tokens)

  2. Create a local config file, e.g at ~/.config/jelease.yaml

  3. Add your local config to test with, including your newly generated PAT. E.g:

    # yaml-language-server: $schema=https://github.com/RiskIdent/jelease/raw/main/jelease.schema.json
    
    packages:
      - name: neuvector
        repos:
          - url: https://github.example.com/some-org/some-repo
            patches:
              - regex:
                  file: helm/charts/ri-neuvector/Chart.yaml
                  match: '^appVersion: .*'
                  replace: 'appVersion: {{ .Version }}'
              - regex:
                  file: helm/charts/ri-neuvector/Chart.yaml
                  match: '^version: (.*)'
                  replace: 'version: {{ index .Groups 1 | versionBump "0.0.1" }}'
    
    github:
      url: https://github.example.com
    
      auth:
        type: pat
        token: ghp_loremipsum
    
  4. Test that your local config is read correctly:

    go run . config
    
  5. Run Jelease locally, e.g:

    # To test applying changes
    go run . apply neuvector v1.2.3 --dryrun
    
    # To test creating PRs
    go run . apply neuvector v1.2.3
    
    # To test the webhook receiver server, without creating issues or PRs
    go run . serve --dryrun
    
    # To test the webhook receiver server, with creating issues and PRs
    go run . serve
    
  6. To test out the webhooks, you can make use of our example webhook like so:

    curl localhost:8080/webhook -d @examples/newreleasesio-webhook.json
    

Development

Prerequisites:

The HTML pages are templated using Templ. This is a manual step that needs to be done after each code change to any .templ files.

go generate

The generate command effectively runs go run ..., so you don't need templ CLI installed.

Building the application and docker image

VERSION=v0.4.1

podman build . -t ghcr.io/riskident/jelease:${VERSION} --build-arg VERSION=${VERSION}
podman tag ghcr.io/riskident/jelease:{${VERSION},latest}

podman login ghcr.io
podman push ghcr.io/riskident/jelease:${VERSION}
podman push ghcr.io/riskident/jelease:latest

Releasing

Create and push a Git tag (prefixed with "v"). Our GitHub Action workflow with goreleaser will build and create the release.

git checkout main
git pull

git tag v0.4.1 -m "v0.4.1"
git push --tags

The gopher logo is designed by Kristin Weyand, an employee at Risk.Ident.

The gopher logo of Jelease was inspired by the original Go gopher, designed by Renee French.

License

This repository complies with the REUSE recommendations.

Different licenses are used for different files. In general:

Please see each file's header or accompanied .license file for specifics.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
git
newreleases
An abstraction for interfacing with the newreleases.io api client
An abstraction for interfacing with the newreleases.io api client
patch/filestore
Package filestore contains a simple and minimal abstraction over OS operations for reading and writing to files.
Package filestore contains a simple and minimal abstraction over OS operations for reading and writing to files.
templates
components
templ: version: v0.2.648
templ: version: v0.2.648
pages
templ: version: v0.2.648
templ: version: v0.2.648

Jump to

Keyboard shortcuts

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