blob: 1071410e22d42b634416024178626758e4fe9760 [file] [log] [blame]
Zack Williamsc2140b92018-04-05 09:19:22 -07001# Makefile for testing JJB jobs in a virtualenv
Zack Williamsc2140b92018-04-05 09:19:22 -07002.PHONY: test clean
3
Matteo Scandolo08900f72021-09-07 15:01:10 -07004SHELL = bash -e -o pipefail
Zack Williamsc2140b92018-04-05 09:19:22 -07005VENV_DIR ?= venv-jjb
Zack Williamsccc14742020-01-22 13:15:59 -07006JJB_VERSION ?= 3.2.0
Zack Williamsc2140b92018-04-05 09:19:22 -07007JOBCONFIG_DIR ?= job-configs
8
9$(VENV_DIR):
10 @echo "Setting up virtualenv for JJB testing"
Zack Williamsbe542312022-06-23 21:51:32 -070011 python3 -m venv $@
Zack Williamsc2140b92018-04-05 09:19:22 -070012 $@/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)