今回 pbrisbin/pushover orb を変更した。PR を送る前に、動作確認がてらしばらく使っている。今後のためにやり方を残しておく。

  1. 動作確認用の orb を publish するために masutaka/pushover という scope を作る。orb の scope は一度作ったら削除できず、リネームしか出来ないようだ。自分用なので気にしないことにする。
$ circleci orb create masutaka/pushover
You are creating an orb called "masutaka/pushover".

You will not be able to change the name of this orb.

If you change your mind about the name, you will have to create a new orb with the new name.

✔ Are you sure you wish to create the orb: `masutaka/pushover`: y
Orb `masutaka/pushover` created.
Please note that any versions you publish of this orb are world-readable.
You can now register versions of `masutaka/pushover` using `circleci orb publish`.
  1. circleci/orb-tools を使うと面倒な publish を自動化出来る関係で、orb は src/ 以下の複数の .yml によって構成されていることが多い。ちょっと古くなっているが、以前 [2019-12-20-1] で説明した。

以下のコマンドで src/ 以下の .yml を 1 つにまとめることが出来る。

$ circleci config pack src > orb.yml
  1. 作られた orb.yml は orb publish サブコマンドで一時的に公開することが出来る。
$ circleci orb publish orb.yml masutaka/pushover@dev:alpha
Orb `masutaka/pushover@dev:alpha` was published.
Please note that this is an open orb and is world-readable.
Note that your dev label `dev:alpha` can be overwritten by anyone in your organization.
Your dev orb will expire in 90 days unless a new version is published on the label `dev:alpha`.

上に書いてあるとおり、いわゆる publish された状態にはなったが 90 日経つと使えなくなる。orb は 1.2.3 のようなセマンティックバージョンは消えないが、それ以外のバージョン(dev:alpha 等)は 90 日後に消える。

orb info サブコマンドで情報を得ることが出来る。

$ circleci orb info masutaka/pushover@dev:alpha

This orb hasn't published any versions yet.

Total-commands: 1
Total-executors: 1
Total-jobs: 1

## Statistics (30 days):
Builds: 0
Projects: 0
Orgs: 0

Learn more about this orb online in the CircleCI Orb Registry:
https://circleci.com/orbs/registry/orb/masutaka/pushover
  1. 上記例の場合、.circleci/config.yml にはこのように書いて使う。
orbs:
  pushover: masutaka/pushover@dev:alpha

おまけ: 開発バージョンだけ公開された orb であれば、scope の情報は取れないようだ。

$ circleci orb info masutaka/pushover
# => 開発バージョンしか公開していない scope の情報を取れない

$ circleci orb info masutaka/tfupdate
# => セマンティックバージョンを公開しているので scope の情報を取れる