プラグイン

Updated 2 years ago by Admin

プラグインは、コマンドをカプセル化するDockerコンテナであり、パイプラインで共有して再利用できます。プラグインを使用して、アーティファクトの構築と公開、通知の送信などを行います。

Slackプラグインの例:

   1  kind: pipeline
2 type: kubernetes
3 name: default
4
5 steps:
6 - name: build
7 image: node
8 commands:
9 - npm install
10 - npm test
11
12 - name: notify
13 image: plugins/slack
14 settings:
15 webhook: https://hooks.slack.com/services/...

ご覧のとおり、プラグインは単なるDockerコンテナです。誰でもロジックをカプセル化し、Dockerイメージとしてバンドルし、Dockerレジストリに公開して、組織やより広範なコミュニティと共有できます。


シークレット

from_secret構文を使用して、名前付きシークレットから任意の構成パラメータを取得する機能を提供します。

シークレットを使用したSlackプラグインの例:

   5  steps: 
6 - name: build
7 image: node
8 commands:
9 - npm install
10 - npm test
11
12 - name: notify
13 image: plugins/slack
14 settings:
15 webhook:
16 from_secret: webhook

シークレットを使用したNPMプラグインの例:

   5  steps: 
6 - name: build
7 image: node
8 commands:
9 - npm install
10 - npm test
11
12 - name: publish
13 image: plugins/npm
14 settings:
15 username:
16 from_secret: username
17 password:
18 from_secret: password


レジストリ

コミュニティは、オープンソースプラグインのパブリックレジストリを維持しています。プラグインレジストリはplugins.drone.ioで閲覧できます。


How did we do?