Run batches on Windows hosts with Jenkins
The windows runner sends each run of qa batch to a Windows host, as a build of a Jenkins job that runs the
command it gets. Use it when your code only runs on Windows. To run your batches in a Jenkins pipeline instead, see
CI integration.
Set up the Jenkins job
-
Start the QA-Board server with Jenkins credentials in its
JENKINS_AUTHenvironment variable, so that it can start and follow builds: see the server's environment variables. -
Create a Jenkins job:
-
enable Trigger builds remotely, and note its token;
-
make it parameterized, with a String parameter named task: the command to run;
-
add a build step Execute Windows batch command:
REM if the job needs shared drivesnet use \\server\share@echo "%task%""%task%""
-
-
Give the job to
qa, in qaboard.yaml:qaboard.yamlrunners:default: localjenkins:build_url: https://jenkins.kitefin.example/job/my-team/job/WindowsExecutortoken: "1234"Or with the
QA_RUNNERS_JENKINS_BUILD_URLandQA_RUNNERS_JENKINS_TOKENenvironment variables.
The QA-Board server starts the builds with its Jenkins credentials. When qa has a token (QABOARD_TOKEN, or
qa auth login), its user must be a developer of the project. Without a token, the server only starts the jobs
listed in the project's qaboard.yaml (runners.jenkins.build_url, or a Jenkins integration),
and not at all when the server requires tokens to send results (ingest.auth set to token). So with
QA_RUNNERS_JENKINS_BUILD_URL set to another job, use a token.
The runner is named windows, while its settings are under runners.jenkins. Set runners.default (e.g. to
local): otherwise qa batch tries to use a runner named jenkins, which doesn't exist.
Send runs to Windows
- For one command:
qa batch --runner windows my-batch. - For all batches:
runners.default: windowsin qaboard.yaml.
A batch can't choose its runner yet: runner: windows in a batch doesn't work, the command line's runner
(--runner or runners.default) always wins.