pub struct RunnerBuilder { /* private fields */ }
Expand description
Builder for Runner
Implementations§
Source§impl RunnerBuilder
impl RunnerBuilder
Sourcepub fn new<P: Into<PathBuf>, S: Into<String>>(
server: Url,
token: S,
build_dir: P,
jobs: JobRunList,
) -> Self
pub fn new<P: Into<PathBuf>, S: Into<String>>( server: Url, token: S, build_dir: P, jobs: JobRunList, ) -> Self
Create a new RunnerBuilder
for the given server url, runner token,
build dir and job list (as created by GitlabLayer::new).
The build_dir is used to store temporary files during a job run.
#[tokio::main]
let dir = tempfile::tempdir().unwrap();
let (layer, jobs) = GitlabLayer::new();
let subscriber = Registry::default().with(layer).init();
let runner = RunnerBuilder::new(
Url::parse("https://gitlab.com/").unwrap(),
"RunnerToken",
dir.path(),
jobs
)
.build()
.await;
Sourcepub fn system_id<S: Into<String>>(self, system_id: S) -> Self
pub fn system_id<S: Into<String>>(self, system_id: S) -> Self
Set the system_id for this runner
The system_id will be truncated to 64 characters to match gitlabs limit, but no further validation will be done. It’s up to the caller to ensure the system_id is valid for gitlab
Sourcepub fn version<S: Into<String>>(self, version: S) -> Self
pub fn version<S: Into<String>>(self, version: S) -> Self
Set the version reported by the gitlab runner
The version will be truncated to 2048 characters
Sourcepub fn revision<S: Into<String>>(self, revision: S) -> Self
pub fn revision<S: Into<String>>(self, revision: S) -> Self
Set the revision reported by the gitlab runner
The revision will be truncated to 255 characters
Sourcepub fn platform<S: Into<String>>(self, platform: S) -> Self
pub fn platform<S: Into<String>>(self, platform: S) -> Self
Set the platform reported by the gitlab runner
The platform will be truncated to 255 characters
Sourcepub fn architecture<S: Into<String>>(self, architecture: S) -> Self
pub fn architecture<S: Into<String>>(self, architecture: S) -> Self
Set the architecture reported by the gitlab runner
The architecture will be truncated to 255 characters