Devin Lim | 32175a1 | 2018-04-13 15:15:15 -0700 | [diff] [blame] | 1 | # Makefile for testing JJB jobs in a virtualenv |
| 2 | |
| 3 | .PHONY: test clean |
| 4 | |
| 5 | VENV_DIR ?= venv-jjb |
Zack Williams | 05f0608 | 2020-01-22 14:19:34 -0700 | [diff] [blame] | 6 | JJB_VERSION ?= 3.2.0 |
Devin Lim | 32175a1 | 2018-04-13 15:15:15 -0700 | [diff] [blame] | 7 | JOBCONFIG_DIR ?= job-configs |
| 8 | |
| 9 | $(VENV_DIR): |
| 10 | @echo "Setting up virtualenv for JJB testing" |
Darius | 87b5583 | 2021-12-15 16:12:38 -0800 | [diff] [blame] | 11 | python3 -m venv $@ |
Devin Lim | 32175a1 | 2018-04-13 15:15:15 -0700 | [diff] [blame] | 12 | $@/bin/pip install jenkins-job-builder==$(JJB_VERSION) pipdeptree |
| 13 | |
| 14 | $(JOBCONFIG_DIR): |
| 15 | mkdir $@ |
| 16 | |
| 17 | test: $(VENV_DIR) $(JOBCONFIG_DIR) |
| 18 | source $(VENV_DIR)/bin/activate ; \ |
| 19 | pipdeptree ; \ |
| 20 | jenkins-jobs -l DEBUG test --recursive -o $(JOBCONFIG_DIR) jjb/ ; |
| 21 | |
| 22 | clean: |
| 23 | rm -rf $(VENV_DIR) $(JOBCONFIG_DIR) |