blob: 4d3b01c336ef1fbe06800e7c8f3e7940574f1023 [file] [log] [blame]
Joey Armstrongf3208602023-06-03 15:12:23 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
Joey Armstrong6a9013e2024-02-01 17:56:57 -05003# Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors
Joey Armstrongf3208602023-06-03 15:12:23 -04004#
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# -----------------------------------------------------------------------
17# Intent: Helper makefile target used to setup for a release
18# -----------------------------------------------------------------------
19
20$(if $(DEBUG),$(warning ENTER))
21
22##-------------------##
23##---] GLOBALS [---##
24##-------------------##
25jjb-gen-dir := build
Joey Armstrong095f5a22023-08-18 17:46:18 -040026# JJB_DEBUG := true
Joey Armstrongf3208602023-06-03 15:12:23 -040027
28##-------------------##
29##---] TARGETS [---##
30##-------------------##
31all: help
32
33## -----------------------------------------------------------------------
34## Intent: Generate pipeline jobs
35## -----------------------------------------------------------------------
36.PHONY: jjb-gen
37
Joey Armstrong095f5a22023-08-18 17:46:18 -040038jjb-gen-args := $(null)
39$(if $(JJB_DEBUG),$(eval jjb-gen-args += --log_level DEBUG))
40
Joey Armstrongf3208602023-06-03 15:12:23 -040041jjb-gen-log := $(jjb-gen-dir)/jjb-gen.log
Joey Armstrongcb896602023-07-21 16:38:42 -040042jjb-gen: $(venv-activate-script)
Joey Armstrong095f5a22023-08-18 17:46:18 -040043
Joey Armstrongdd334492023-07-09 17:59:02 -040044 $(call banner-enter,Target $@)
Joey Armstrongf3208602023-06-03 15:12:23 -040045 @mkdir -p $(jjb-gen-dir)
Joey Armstrongf3208602023-06-03 15:12:23 -040046 @touch "$(jjb-gen-dir)/.sentinel"
Joey Armstrongcb896602023-07-21 16:38:42 -040047 ( \
48 $(activate) \
Joey Armstrong095f5a22023-08-18 17:46:18 -040049 && jenkins-jobs $(jjb-gen-args) test $(PWD)/jjb -o $(jjb-gen-dir) 3>&1 2>&1 \
Joey Armstrongdd334492023-07-09 17:59:02 -040050 ) | tee "$(jjb-gen-log)"
Joey Armstrongf3208602023-06-03 15:12:23 -040051
52 ifdef LOGS
53 -@less "$(jjb-gen-log)"
54 endif
55
56 ifdef VERBOSE
57 @echo
58 @echo "** Display generated pipelines"
59 find "$(jjb-gen-dir)" -newer "$(jjb-gen-dir)/.sentinel" -ls
60 endif
61
Joey Armstrongdd334492023-07-09 17:59:02 -040062 $(call banner-leave,Target $@)
63
Joey Armstrongf3208602023-06-03 15:12:23 -040064## -----------------------------------------------------------------------
65## -----------------------------------------------------------------------
66sterile ::
67 $(RM) -r $(jjb-gen-dir)
68
69$(if $(DEBUG),$(warning LEAVE))
70
71# [EOF]