-
Notifications
You must be signed in to change notification settings - Fork 130
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
Agent hooks #896
Agent hooks #896
Conversation
return nil | ||
} | ||
|
||
if os.Getenv(analytics.StepExecutionIDEnvKey) != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work with Run bitrise Step too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's the point of this. Everything running in a scrip step has this env var defined, so the CLI process spawned there will run into this block.
cli/agent.go
Outdated
log.Print() | ||
|
||
cmd := exec.Command(hooks.DoOnBuildStart) | ||
cmd.Stdout = os.Stdout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging to stdout could be problematic as it would not be in the JSON log format expected in CI run. It can be omitted or wrapped in additional logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, good point! Take a look now
type WorkflowRunner struct { | ||
config RunConfig | ||
config RunConfig | ||
agentConfig *configs.AgentConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document why agentconfig has top be seperate from config for posterity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Checklist
README.md
is updated with the changes (if needed)Version
Requires a MINOR version update
Context
Same theme as #894, but this PR is about running arbitrary commands before and after the CLI picks up a build in agent mode.
Changes
workflow
tobuild
as these actions are meant to be run in the context of a build, i.e. when an agent picks up a build to execute. One such CLI invocation can result in multiple workflows executed, such asrun_before
,run_after
and innerbitrise run workflow
calls.cli/agent.go
Investigation details
Decisions