Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: add Rack application skeleton for automatic deployment #45

Merged
merged 7 commits into from
Dec 11, 2024

Conversation

otegami
Copy link
Contributor

@otegami otegami commented Dec 10, 2024

GitHub: GH-43

In this PR, we set up a Rack application skeleton for automatic deployment using webhook.
At the following PRs, we will implement the logic of automatic sign as first steps.

Call webhook

$ cd ansible/files/home/deployer/webhook
$ gem install rackup
$ bundle install
$ rackup &
$ curl localhost:9292
127.0.0.1 - - [10/Dec/2024:16:33:28 +0900] "GET / HTTP/1.1" 200 - 0.0001
Hello deployer

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このファイルを追加してユーザーを追加したと言い張るのは強引かな。。。

ansible/files/home/signer/webhook-auto-signer/.keep Outdated Show resolved Hide resolved
@kou
Copy link
Member

kou commented Dec 10, 2024

Rackアプリケーションのスケルトンを追加、とかを最初のステップにした方がいいんじゃないかな。

@otegami
Copy link
Contributor Author

otegami commented Dec 10, 2024

次の項目の作業を並列して進めようと思っていたので、作業directoryを先に用意したかったんですが、
並列で作業をしなくなったので、Rackアプリケーションのスケルトンを追加まで対応しようと思います。

  • Set up a Rack-based API application as a GitHub webhook listener.
  • Implement Rake tasks for signing packages.

ref: #43

@otegami otegami marked this pull request as draft December 10, 2024 03:50
@otegami otegami force-pushed the release-add-webhook-auto-signer-user branch 2 times, most recently from a5aa194 to 65c25d7 Compare December 10, 2024 06:27
GitHub: groongaGH-43

In this PR, we set up a rack application skeleton of webhook auto
signer. At the following PRs, we will implement the logic.
@otegami otegami force-pushed the release-add-webhook-auto-signer-user branch from 65c25d7 to e8a3a3b Compare December 10, 2024 07:23
@otegami otegami changed the title release: add signer user for packages and archives using a webhook release: add Rack application skeleton of webhook auto signer Dec 10, 2024
@otegami
Copy link
Contributor Author

otegami commented Dec 10, 2024

Rackアプリケーションのスケルトンを追加してみました。
lib配下のディレクトリ構造をどうするとよいのか悩んでいて、現状だとapp.rbだけが存在していれば良いので、そこまで構造化する必要はなさそうな気がしておりますmm

lib配下にapp.rbを配置する。

$ tree .
.
├── config.ru
├── Gemfile
├── Gemfile.lock
└── lib
    └── app.rb

直下にapp.rbを配置する。

tree .
.
├── app.rb
├── config.ru
├── Gemfile
└── Gemfile.lock

@otegami otegami marked this pull request as ready for review December 10, 2024 07:50
base_dir = Pathname(__FILE__).dirname
lib_dir = base_dir + "lib"

$LOAD_PATH.unshift(lib_dir.to_s)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これなしで全部require_relativeでやってもいいかも。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix: 48c0c04

@@ -0,0 +1,7 @@
module WebhookSigner
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webhook/ディレクトリーの下だからWebhookいらなくない?

Copy link
Contributor Author

@otegami otegami Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix: fe00849 deployerに命名を変えたので、signerだけでも違和感がなくなったので削除しました!

@kou
Copy link
Member

kou commented Dec 11, 2024

あぁ、やっぱり、signerじゃなくてdeployerにしようか。

最終的に、サインだけじゃなくてパッケージ諸々を使えるようにするためのすべてをやるんだよ。

@otegami
Copy link
Contributor Author

otegami commented Dec 11, 2024

あぁ、やっぱり、signerじゃなくてdeployerにしようか。
最終的に、サインだけじゃなくてパッケージ諸々を使えるようにするためのすべてをやるんだよ。

ありがとうございます!
命名の部分で悩んでいたいのですが、これで解決しそうです。(署名にとらわれて過ぎてしまっていた...)

@otegami
Copy link
Contributor Author

otegami commented Dec 11, 2024

ここまで頂いたレビューコメントの対応をしました。

@@ -0,0 +1,7 @@
module Signer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こいつもDeployerにしない?

デプロイの一貫でサインするみたいな位置づけにできないかな。

Copy link
Contributor Author

@otegami otegami Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix: 12e61a3 なるほどです!

Because Deployer will do sign not Signer.
@otegami otegami changed the title release: add Rack application skeleton of webhook auto signer release: add Rack application skeleton for automatic deployment Dec 11, 2024
@kou
Copy link
Member

kou commented Dec 11, 2024

ライセンスヘッダーとCOPYINGを入れて。

アプリケーションだからGPLv3 or laterかな。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@otegami
Copy link
Contributor Author

otegami commented Dec 11, 2024

fix: f4c7ccf にて、ライセンスヘッダーとCOPYINGを入れました 🙏🏾

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これにも入れておいて。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix: a799593 了解です!

@kou kou merged commit fd8bf4c into groonga:main Dec 11, 2024
@otegami otegami deleted the release-add-webhook-auto-signer-user branch December 11, 2024 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants