Joey Armstrong | 6540541 | 2022-11-22 10:43:06 -0500 | [diff] [blame] | 1 | # -*- makefile -*- |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 2 | # ----------------------------------------------------------------------- |
| 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 Armstrong | 6540541 | 2022-11-22 10:43:06 -0500 | [diff] [blame] | 17 | |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 18 | # Makefile for testing JJB jobs in a virtualenv |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 19 | .PHONY: all clean help test |
| 20 | .DEFAULT_GOAL := all |
Joey Armstrong | b3a0641 | 2023-02-06 09:58:58 -0500 | [diff] [blame] | 21 | # .DEFAULT_GOAL := lint-jjb |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 22 | |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 23 | ##-------------------## |
| 24 | ##---] GLOBALS [---## |
| 25 | ##-------------------## |
| 26 | TOP ?= . |
| 27 | MAKEDIR ?= $(TOP)/makefiles |
| 28 | export SHELL := bash -e -o pipefail |
| 29 | |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 30 | ##--------------------## |
| 31 | ##---] INCLUDES [---## |
| 32 | ##--------------------## |
Joey Armstrong | b3a0641 | 2023-02-06 09:58:58 -0500 | [diff] [blame] | 33 | -include config.mk |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 34 | include $(MAKEDIR)/include.mk |
| 35 | |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 36 | VENV_DIR ?= venv-jjb |
Joey Armstrong | 0895a88 | 2023-02-06 14:50:39 -0500 | [diff] [blame^] | 37 | JJB_VERSION ?= 2.8.0 |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 38 | # JJB_VERSION ?= 4.1.0 |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 39 | JOBCONFIG_DIR ?= job-configs |
| 40 | |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 41 | $(JOBCONFIG_DIR): |
| 42 | mkdir $@ |
| 43 | |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 44 | ## ----------------------------------------------------------------------- |
| 45 | ## ----------------------------------------------------------------------- |
Joey Armstrong | b3a0641 | 2023-02-06 09:58:58 -0500 | [diff] [blame] | 46 | # lint : lint-jjb |
| 47 | lint-tox: |
| 48 | tox -e py310 |
| 49 | |
| 50 | ## ----------------------------------------------------------------------- |
| 51 | ## ----------------------------------------------------------------------- |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 52 | .PHONY: test |
| 53 | test: $(venv-activate-script) $(JOBCONFIG_DIR) |
| 54 | $(activate) \ |
| 55 | && pipdeptree \ |
| 56 | && jenkins-jobs -l DEBUG test --recursive --config-xml -o "$(JOBCONFIG_DIR)" jjb/ ; |
Zack Williams | 9ac51db | 2018-04-16 16:44:24 -0700 | [diff] [blame] | 57 | |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 58 | ## ----------------------------------------------------------------------- |
| 59 | ## ----------------------------------------------------------------------- |
| 60 | .PHONY: clean |
Zack Williams | c2140b9 | 2018-04-05 09:19:22 -0700 | [diff] [blame] | 61 | clean: |
Joey Armstrong | 3f575f7 | 2023-01-15 23:49:19 -0500 | [diff] [blame] | 62 | $(RM) -r $(JOBCONFIG_DIR) |
| 63 | |
| 64 | include $(ONF_MAKE)/help/trailer.mk |
Joey Armstrong | 6540541 | 2022-11-22 10:43:06 -0500 | [diff] [blame] | 65 | |
| 66 | # [EOF] |