-
Notifications
You must be signed in to change notification settings - Fork 38
feat(runner): Integrate runner for Jenkins jobs #411
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
Conversation
|
||
import "os" | ||
|
||
type JenkinsJob struct{} |
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.
This is not related to your change, since the other runners have the same issue, but it's something that we could tackle in another patch.
It seems that the "factory functions" are not being used outside of tests, when they could also be used in runner.go
in the switch clause.
To run this locally, since this is just a client-side update you have two options: a) run full development environment including CAS, controlplane locally or For the latter, and to perform an attestation, even locally, you need to configure a workflow + robot-account and this is how you do it.
schemaVersion: v1
runner:
type: "JENKINS_JOB"
go run main.go wf create --name test --project jktest --contract jenkins.yaml Export the robot-account as an env variable export CHAINLOOP_ROBOT_ACCOUNT=REDACTED.REDACTED.tBAf4SzsCWjFzuaS9R6a0PBNSo2_wdPjZKH1x_ogObc and then run an $ go run main.go att init
ERR The contract expects the attestation to be crafted in a runner of type "jenkins-job" but couldn't be detected. Use --dry-run flag if development after this you know how to proceed, impersonating the env vars or even running the modified version of this CLI (compiled with I hope it helps |
#412 has been merged, please rebase main now, thanks! |
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.
LGTM!
Next we'll need to update the docs https://docs.chainloop.dev/reference/operator/contract#runner-context but we can wait until they are moved to the main repo. @danlishka is working on that
Thanks!
Signed-off-by: Mattia Buccarella <m.buccarella@gmail.com>
Signed-off-by: Mattia Buccarella <m.buccarella@gmail.com>
Signed-off-by: Mattia Buccarella <m.buccarella@gmail.com>
Signed-off-by: Mattia Buccarella <m.buccarella@gmail.com>
Fixes the following issue:
#88
Definition of done:
[x] Implementation of the runner
[x] Unit tests
[x] Local tests
Jenkins output of
att init
Generated chainloop_attestation.tmp.json