blob: 3478b0f7138c60a1e30ca44281ca2bcb62b3031d [file] [log] [blame]
Joey Armstrong65405412022-11-22 10:43:06 -05001# -*- makefile -*-
Joey Armstrong3f575f72023-01-15 23:49:19 -05002# -----------------------------------------------------------------------
3# Copyright 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16# -----------------------------------------------------------------------
Joey Armstrong65405412022-11-22 10:43:06 -050017
Zack Williamsc2140b92018-04-05 09:19:22 -070018# Makefile for testing JJB jobs in a virtualenv
Joey Armstrong3f575f72023-01-15 23:49:19 -050019.PHONY: all clean help test
20.DEFAULT_GOAL := all
Joey Armstrongb3a06412023-02-06 09:58:58 -050021# .DEFAULT_GOAL := lint-jjb
Zack Williamsc2140b92018-04-05 09:19:22 -070022
Joey Armstrong3f575f72023-01-15 23:49:19 -050023##-------------------##
24##---] GLOBALS [---##
25##-------------------##
26TOP ?= .
27MAKEDIR ?= $(TOP)/makefiles
28export SHELL := bash -e -o pipefail
29
Joey Armstrong3f575f72023-01-15 23:49:19 -050030##--------------------##
31##---] INCLUDES [---##
32##--------------------##
Joey Armstrongb3a06412023-02-06 09:58:58 -050033-include config.mk
Joey Armstrong3f575f72023-01-15 23:49:19 -050034include $(MAKEDIR)/include.mk
35
Zack Williamsc2140b92018-04-05 09:19:22 -070036VENV_DIR ?= venv-jjb
Joey Armstrong3f575f72023-01-15 23:49:19 -050037# JJB_VERSION ?= 4.1.0
Zack Williamsc2140b92018-04-05 09:19:22 -070038JOBCONFIG_DIR ?= job-configs
39
Zack Williamsc2140b92018-04-05 09:19:22 -070040$(JOBCONFIG_DIR):
41 mkdir $@
42
Joey Armstrong3f575f72023-01-15 23:49:19 -050043## -----------------------------------------------------------------------
44## -----------------------------------------------------------------------
Joey Armstrongb3a06412023-02-06 09:58:58 -050045# lint : lint-jjb
46lint-tox:
47 tox -e py310
48
49## -----------------------------------------------------------------------
50## -----------------------------------------------------------------------
Joey Armstrong3f575f72023-01-15 23:49:19 -050051.PHONY: test
52test: $(venv-activate-script) $(JOBCONFIG_DIR)
53 $(activate) \
54 && pipdeptree \
55 && jenkins-jobs -l DEBUG test --recursive --config-xml -o "$(JOBCONFIG_DIR)" jjb/ ;
Zack Williams9ac51db2018-04-16 16:44:24 -070056
Joey Armstrong3f575f72023-01-15 23:49:19 -050057## -----------------------------------------------------------------------
58## -----------------------------------------------------------------------
59.PHONY: clean
Zack Williamsc2140b92018-04-05 09:19:22 -070060clean:
Joey Armstrong3f575f72023-01-15 23:49:19 -050061 $(RM) -r $(JOBCONFIG_DIR)
62
63include $(ONF_MAKE)/help/trailer.mk
Joey Armstrong65405412022-11-22 10:43:06 -050064
65# [EOF]