blob: c36248bf969b9e72f2b8f322c90554f84fc5f5c7 [file] [log] [blame]
Joey Armstrong65405412022-11-22 10:43:06 -05001# -*- makefile -*-
2
Zack Williamsc2140b92018-04-05 09:19:22 -07003# Makefile for testing JJB jobs in a virtualenv
Zack Williamsc2140b92018-04-05 09:19:22 -07004.PHONY: test clean
5
Joey Armstrongca4cb462023-01-12 17:51:05 -05006SHELL := bash -e -o pipefail
Zack Williamsc2140b92018-04-05 09:19:22 -07007VENV_DIR ?= venv-jjb
Zack Williams5f257162022-07-25 14:22:29 -07008JJB_VERSION ?= 4.1.0
Zack Williamsc2140b92018-04-05 09:19:22 -07009JOBCONFIG_DIR ?= job-configs
10
11$(VENV_DIR):
12 @echo "Setting up virtualenv for JJB testing"
Zack Williamsbe542312022-06-23 21:51:32 -070013 python3 -m venv $@
Zack Williamsc2140b92018-04-05 09:19:22 -070014 $@/bin/pip install jenkins-job-builder==$(JJB_VERSION) pipdeptree
15
16$(JOBCONFIG_DIR):
17 mkdir $@
18
Zack Williams9ac51db2018-04-16 16:44:24 -070019lint:
20 yamllint -c yamllint.conf jjb/
21
Zack Williamsc2140b92018-04-05 09:19:22 -070022test: $(VENV_DIR) $(JOBCONFIG_DIR)
23 source $(VENV_DIR)/bin/activate ; \
24 pipdeptree ; \
Zack Williams1c5c5252018-04-20 13:50:44 -070025 jenkins-jobs -l DEBUG test --recursive --config-xml -o $(JOBCONFIG_DIR) jjb/ ;
Zack Williamsc2140b92018-04-05 09:19:22 -070026
27clean:
Joey Armstrong65405412022-11-22 10:43:06 -050028 $(RM) -r $(VENV_DIR) $(JOBCONFIG_DIR)
29
30# [EOF]