-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Earthfile for deps, build and docker image * fix null pointer dereference segfault when no http response is received from jira * Add authtype and skipcertverify config options. Print list of statuses if status is misconfigured. * Add helm chart and instructions in readme. Add timeout for http requests to app * Add dry run support. Make issue descr. configurable. Update README. * Apply suggested chart improvements * Apply suggested README, source and gitignore improvements * Remove superfluous variable * Fix conditional comma formatting Co-authored-by: Kalle Fagerberg <[email protected]> * Remove authType variable Co-authored-by: Kalle Fagerberg <[email protected]> * remove helm chart and add reference to new location in helm repo * Updated formatting in README.md Co-authored-by: Kalle Fagerberg <[email protected]>
- Loading branch information
1 parent
50ffa91
commit 5df9d38
Showing
4 changed files
with
160 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
VERSION 0.6 | ||
FROM golang:1.19.0-bullseye | ||
WORKDIR /jelease | ||
|
||
deps: | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
SAVE ARTIFACT go.mod AS LOCAL go.mod | ||
SAVE ARTIFACT go.sum AS LOCAL go.sum | ||
|
||
build: | ||
FROM +deps | ||
COPY main.go . | ||
RUN go build -o build/jelease main.go | ||
SAVE ARTIFACT build/jelease /jelease AS LOCAL build/jelease | ||
|
||
docker: | ||
FROM ubuntu:22.04 | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends ca-certificates \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY +build/jelease . | ||
CMD ["/jelease"] | ||
SAVE IMAGE jelease:latest | ||
SAVE IMAGE --push docker-riskident.2rioffice.com/platform/nicolasmohr/jelease |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,49 @@ | ||
# jelease - A newreleases.io ➡️ Jira connector | ||
|
||
Automatically create Jira tickets when a newreleases.io release is detected using webhooks. | ||
Automatically create Jira tickets when a newreleases.io release | ||
is detected using webhooks. | ||
|
||
## Configuration: | ||
## Configuration | ||
|
||
The application requires the following environment variables to be set: | ||
- `JELEASE_PORT`: The port the application is expecting traffic on | ||
- `JELEASE_JIRA_URL`: The URL of your Jira instance | ||
- `JELEASE_JIRA_USER`: Jira username to authenticate API requests | ||
- `JELEASE_JIRA_TOKEN`: Jira API token, can also be a password in self-hosted instances | ||
- `JELEASE_PROJECT`: Jira Project key the tickets will be created in | ||
- `JELEASE_ADD_LABELS`: Add additional labels to the created jira ticket | ||
- `JELEASE_DEFAULT_STATUS`: The status the created tickets are supposed to have | ||
- Connection and authentication | ||
|
||
- `JELEASE_AUTH_TYPE`: One of [pat, token]. Determines whether to authenticate using personal access token (on premise) or jira api token (jira cloud) | ||
- `JELEASE_JIRA_TOKEN`: Jira API token, can also be a password in self-hosted instances | ||
- `JELEASE_JIRA_URL`: The URL of your Jira instance | ||
- `JELEASE_JIRA_USER`: Jira username to authenticate API requests | ||
- `JELEASE_PORT`: The port the application is expecting traffic on | ||
- `JELEASE_INSECURE_SKIP_CERT_VERIFY`: Skips verification of Jira server certs when performing http requests. | ||
- Jira ticket creation: | ||
- `JELEASE_ADD_LABELS`: Comma-separated list of labels to add to the created jira ticket | ||
- `JELEASE_DEFAULT_STATUS`: The status the created tickets are supposed to have | ||
- `JELEASE_DRY_RUN`: Don't create tickets, log when a ticket would be created | ||
- `JELEASE_ISSUE_DESCRIPTION`: The description for created issues | ||
- `JELEASE_PROJECT`: Jira Project key the tickets will be created in | ||
|
||
They can also be specified using a `.env` file in the application directory. | ||
|
||
## Building the application | ||
## Local usage | ||
|
||
`go build` | ||
1. Populate a `.env` file with configuration values | ||
2. `go run main.go` / `./jelease` | ||
3. Direct newreleases.io webhooks to the `host:port/webhook` route. | ||
|
||
## Usage | ||
## Building the application and docker image | ||
|
||
1. `go run main.go` / `./jelease` | ||
2. Direct newreleases.io webhooks to the `host:port/webhook` route. | ||
The application uses [earthly](https://earthly.dev/get-earthly) for building | ||
and pushing a docker image. | ||
|
||
After installing earthly, the image can be built by running | ||
|
||
```bash | ||
earthly +docker | ||
# if you want to push a new image version | ||
earhtly --push +docker | ||
``` | ||
|
||
## Deployment | ||
|
||
A helm chart deploying the application together with a webhookrelayd sidecar | ||
is available in the | ||
[platform/helm repo](https://github.2rioffice.com/platform/helm/tree/master/charts/jelease) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters