Create a freestyle job with one build step.
If you are running Jenkins on a Windows system:
Execute Windows batch command build step@echo OFF
echo "RUN_TESTS = %RUN_TESTS%"
if "%RUN_TESTS%"=="true" (
echo "RUNNING TESTS!"
) else (
echo "No tests will be run"
)
Follow this link for more details on Windows
If you are running Jenkins on MacOS, Linux, or Docker:
Execute shell build step.#!/bin/bash
echo "RUN_TESTS = $RUN_TESTS"
if [ "$RUN_TESTS" = "true" ];
then
echo "RUNNING TESTS!";
else
echo "No tests will be run...";
fi
Follow this link for more details on MacOS, Linux, and Docker