Currently jenkins cron doesn't support triggering project based on condition.
You can do this in two ways
- i)The simplest way is to create two projects, one for running in even week and other for odd week.
ii)Once the project is triggered you write a condition either using windows batch command or shell script to check if the current week is as expected (Odd/Even) if it meet the condition you proceed the next step or fail it.
But the issue with this solution is you will have a unnecessary project.
- i)A bit hard but stable way is have a Parent Project and two dependent(child) project - i.e one for even and other for odd
ii)In the parent project execute a shell/windows batch command to check if the current week is odd or even refer - Date convert to week number based on it you create a variable and set value as true or false and then write the values into a property file
iii)Then convert the value as a environment variable using Jenkins Environment Injector Plugin (url - https://plugins.jenkins.io/envinject/) for details on how to convert refer - How to set environment variables in Jenkins?, Now you can access the value across the project
iv)Create a new conditional build step (Plugin url - https://plugins.jenkins.io/conditional-buildstep/ )
In that trigger your child project based on comparison of environment variable with a expected condition (i.e if "TRUE" then trigger Odd week project)