blob: c096b44a9a9a552f22664ce853fb66cc314aeecf [file] [log] [blame]
Zack Williamsc2140b92018-04-05 09:19:22 -07001# Makefile for testing JJB jobs in a virtualenv
2
3.PHONY: test clean
4
5VENV_DIR ?= venv-jjb
Zack Williams1c5c5252018-04-20 13:50:44 -07006JJB_VERSION ?= 2.0.5
Zack Williamsc2140b92018-04-05 09:19:22 -07007JOBCONFIG_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 Williams9ac51db2018-04-16 16:44:24 -070017lint:
18 yamllint -c yamllint.conf jjb/
19
Zack Williamsc2140b92018-04-05 09:19:22 -070020test: $(VENV_DIR) $(JOBCONFIG_DIR)
21 source $(VENV_DIR)/bin/activate ; \
22 pipdeptree ; \
Zack Williams1c5c5252018-04-20 13:50:44 -070023 jenkins-jobs -l DEBUG test --recursive --config-xml -o $(JOBCONFIG_DIR) jjb/ ;
Zack Williamsc2140b92018-04-05 09:19:22 -070024
25clean:
26 rm -rf $(VENV_DIR) $(JOBCONFIG_DIR)