Skip to content

Commit

Permalink
chore: referencing the documentation page from the project file https…
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuyuki-baba committed Jan 24, 2022
1 parent 301c819 commit 14d0664
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 10 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# CHANGELOG

## Version 1.3.0 (Dec 29, 2017)

- Fix POST to /typetalk/notify with CSRF protection

## Version 1.2.0 (Mar 14, 2017)

- Support pipeline

## Version 1.1.0 (Feb 25, 2015)

- Add "operation from Typetalk" features

## Version 1.0.0 (May 12, 2014)

- v1 release
- 'Notify When Success' in Post-build Actions section is removed.
- If you use it, please 'Notify end' in Build Environment section instead of it.

## Version 0.9.1 (Feb 3, 2014)

- Initial release ( not finished i18n )
31 changes: 31 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributing to the Typetalk Plugin

Plugin source code is hosted on [GitHub](https://github.com/jenkinsci/typetalk-plugin).
New feature proposals and bug fix proposals should be submitted as
[GitHub pull requests](https://help.github.com/articles/creating-a-pull-request).
Your pull request will be evaluated by the [Jenkins job](https://ci.jenkins.io/job/Plugins/job/typetalk-plugin/).

Before submitting your change, please assure that you've added tests that verify the change.

## Code Coverage

Code coverage reporting is available as a maven target.
Please try to improve code coverage with tests when you submit.

* `mvn -P enable-jacoco clean install jacoco:report` to report code coverage

## Static Analysis

Please don't introduce new spotbugs output.

* `mvn spotbugs:check` to analyze project using [Spotbugs](https://spotbugs.github.io)
* `mvn spotbugs:gui` to review report using GUI

## File format

Files in the repository are in Unix format (LF line terminators).
Please continue using Unix file format for consistency.

## Reporting Issues

Report issues in the [Jenkins issue tracker](https://www.jenkins.io/participate/report-issue/redirect/#18421).
113 changes: 103 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,114 @@
[![Build Status](https://ci.jenkins.io/job/Plugins/job/typetalk-plugin/job/master/badge/icon)](https://ci.jenkins.io/job/Plugins/job/typetalk-plugin/job/master/)
# Typetalk Plugin

This is a Jenkins plugin which notifies to [Typetalk](https://typetalk.com/).
See [Plugin page](https://plugins.jenkins.io/typetalk/) for more details.
## Introduction

# How to build
- ref : https://www.jenkins.io/doc/developer/plugin-development/build-process/
This is a Jenkins plugin which works with [Typetalk](https://typetalk.com/). Typetalk is a chat tool provided by [Nulab](https://nulab.com).

## Launch for development
## Feature

### Send notification to Typetalk

You can send notification to Typetalk when the following build events occur

- when build starts / ends
- when build fails

![](docs/images/post_typetalk.png)

### Operate Jenkins from Typetalk

You can operate Jenkins by mentioning to a bot in Typetalk and this enables you to do ChatOps. If you can understand Japanese, Refer to [this blog entry](http://nulab-inc.com/ja/blog/typetalk/chatops-without-programming) for more details.

This plugin provides some features, like build/list projects.

#### Build project

![](docs/images/chatops-build_en.gif)

#### List projects

![](docs/images/chatops-list_en.gif)

#### Show help messages

![](docs/images/chatops-help_en.gif)

## Configuration

### Global configuration

At first, you must add credential to access Typetalk in the global configuration page.

How to configure credentials:

1. [Register a new application](https://typetalk.in/my/develop/applications/register) via the Typetalk Developer Application Page. Choose 'Client Credentials' in 'Grant Type'. Other items are optional.
2. Input the 'Client ID' and 'Client Secret' displayed on the registration page. Input any value in 'Name'.

![](docs/images/global_configuration.png)

### Job configuration

#### Build Environment

In this section, you can configure notifications about starting/ending build.
You can also change notification message as you like.

![](docs/images/build_environment.png)

#### Post-build Actions

In this section, you can configure notifications about build results.
The notifications are sent when the build doesn't succeed and recovers.

![](docs/images/post_build_actions.png)

#### Pipeline step

You can use typetalk step in your pipeline as well as a classic style job.
When you want to notify a build result, you can use 'typetalkSend' step with 'catchError'.

```
./mvnw hpi:run
node {
catchError {
sh 'might fail'
}
typetalkSend name: 'ikikko test', topicId: 9260
}
```

## Package a plugin file
You can also notify an event which starts and/or ends with 'withTypetalk' step.

```
./mvnw clean hpi:hpi
withTypetalk(name: 'ikikko test', notifyEnd: true, notifyEndMessage: '', notifyStart: true, notifyStartMessage: '', topicId: 9260) {
// some block
}
```

If you don't install gradle, you can use gradlew / gradlew.bat instead of gradle.
#### Notification URL

In order to operate Jenkins from Typetalk, you should set a certain endpoint to Typetalk bot in a topic.

### Bot for all Jenkins projects

This plugin provides the following endpoint to receive message from Typetalk. You have to set it to a webhook URL of Typetalk bot. See the official document for more.

`http://<Jenkins URL>/typetalk/notify`

Then, you can operate Jenkins by mentioning to the bot as follows:

- `@jenkins+ build <project> (<key=value>)`
- `@jenkins+ list (<regexp filter>)`
- `@jenkins+ help (<sub command>)`

In this case, @jenkins+ is your bot name here.

### Bot for a single Jenkins project

By adding project name as a parameter of webhook URL,

`http://<Jenkins URL>/typetalk/notify?project=<project>`

then you can omit the name when mentioning to Typetalk bot like this.

- `@jenkins-project+`
- `@jenkins-project+ build (<key=value>)`
Binary file added docs/images/build_environment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/chatops-build_en.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/chatops-help_en.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/chatops-list_en.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/global_configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/post_build_actions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/post_typetalk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 14d0664

Please sign in to comment.