Zack Williams | c2140b9 | 2018-04-05 09:19:22 -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 | adeb1d4 | 2018-04-10 11:56:48 -0700 | [diff] [blame] | 6 | JJB_VERSION ?= 2.0.3 |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 7 | JOBCONFIG_DIR ?= job-configs |
| 8 | |
| 9 | $(VENV_DIR): |
| 10 | @echo "Setting up virtualenv for JJB testing" |
| 11 | virtualenv $@ |
| 12 | $@/bin/pip install jenkins-job-builder==$(JJB_VERSION) pipdeptree |
| 13 | |
| 14 | $(JOBCONFIG_DIR): |
| 15 | mkdir $@ |
| 16 | |
Zack Williams | 9ac51db | 2018-04-16 16:44:24 -0700 | [diff] [blame] | 17 | lint: |
| 18 | yamllint -c yamllint.conf jjb/ |
| 19 | |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 20 | test: $(VENV_DIR) $(JOBCONFIG_DIR) |
| 21 | source $(VENV_DIR)/bin/activate ; \ |
| 22 | pipdeptree ; \ |
| 23 | jenkins-jobs -l DEBUG test --recursive -o $(JOBCONFIG_DIR) jjb/ ; |
| 24 | |
| 25 | clean: |
| 26 | rm -rf $(VENV_DIR) $(JOBCONFIG_DIR) |