blob: e299ee22e15125e627f0ce0c14b576148432008b [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
Zack Williamsc2140b92018-04-05 09:19:22 -070021
Joey Armstrong3f575f72023-01-15 23:49:19 -050022##-------------------##
23##---] GLOBALS [---##
24##-------------------##
25TOP ?= .
26MAKEDIR ?= $(TOP)/makefiles
27export SHELL := bash -e -o pipefail
28
29NO-LINT-MAKE := true
30NO-LINT-SHELL := true
31
32##--------------------##
33##---] INCLUDES [---##
34##--------------------##
35include $(MAKEDIR)/include.mk
36
Zack Williamsc2140b92018-04-05 09:19:22 -070037VENV_DIR ?= venv-jjb
Joey Armstrong3f575f72023-01-15 23:49:19 -050038# JJB_VERSION ?= 4.1.0
Zack Williamsc2140b92018-04-05 09:19:22 -070039JOBCONFIG_DIR ?= job-configs
40
Zack Williamsc2140b92018-04-05 09:19:22 -070041$(JOBCONFIG_DIR):
42 mkdir $@
43
Joey Armstrong3f575f72023-01-15 23:49:19 -050044## -----------------------------------------------------------------------
45## -----------------------------------------------------------------------
46.PHONY: test
47test: $(venv-activate-script) $(JOBCONFIG_DIR)
48 $(activate) \
49 && pipdeptree \
50 && jenkins-jobs -l DEBUG test --recursive --config-xml -o "$(JOBCONFIG_DIR)" jjb/ ;
Zack Williams9ac51db2018-04-16 16:44:24 -070051
Joey Armstrong3f575f72023-01-15 23:49:19 -050052## -----------------------------------------------------------------------
53## -----------------------------------------------------------------------
54.PHONY: clean
Zack Williamsc2140b92018-04-05 09:19:22 -070055clean:
Joey Armstrong3f575f72023-01-15 23:49:19 -050056 $(RM) -r $(JOBCONFIG_DIR)
57
58include $(ONF_MAKE)/help/trailer.mk
Joey Armstrong65405412022-11-22 10:43:06 -050059
60# [EOF]