jelease

command module
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 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:
              - file: helm/charts/ri-neuvector/Chart.yaml
                regex:
                  match: '^appVersion: .*'
                  replace: 'appVersion: {{ .Version }}'
              - file: helm/charts/ri-neuvector/Chart.yaml
                regex:
                  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
    

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

  1. Create a new release on GitHub, with "v" prefix on version: https://github.com/RiskIdent/jelease/releases/new

  2. Write a small changelog, like so:

    ## Changes (since v0.3.0)
    
    - Added some feature. (#123)
    
  3. Our GitHub Action with goreleaser will build and add artifacts to release

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

Jump to

Keyboard shortcuts

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