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 a logger for release tasks #48

Closed

Conversation

otegami
Copy link
Contributor

@otegami otegami commented Dec 23, 2024

GitHub: GH-43

In this PR, we add a logger for release tasks.
Our log will be output in log/error.log.

GitHub: groongaGH-43

In this PR, we add a logger for release tasks.
Our log will be output in `log/error.log`.
@@ -94,7 +95,8 @@ def process_payload!(payload)
def deploy(payload)
Thread.new do
# TODO: call rake tasks for sign packages.
# TODO: write down the errors into log files.
rescue => e
Logger.log("error.log", e.message)
Copy link
Member

Choose a reason for hiding this comment

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

デプロイ処理はspawnで動かすからサブプロセスの標準出力と標準エラー出力を直接ログファイルにつなげたいかなー

Copy link
Contributor Author

Choose a reason for hiding this comment

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

次のようなイメージでいるのですがあっていますか?

def deploy(payload)
  ...
  Process.spawn(
    release_rake_command,
    out: "log/stdout.log",
    err: "log/stderr.log"
  )
end

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.

了解です。
Loggerは必要なさそうなので、closeしてリリース用のRakeタスクを呼ぶ部分の実装をします。

Copy link
Member

Choose a reason for hiding this comment

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

あ、ごめん、作っちゃった。

@otegami otegami closed this Dec 23, 2024
@otegami otegami deleted the release-add-logger-for-release-tasks branch December 23, 2024 08:14
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