blob: 9778337ad5d91c0bc782d12fdab544b3ab94d0cf [file] [log] [blame]
Joey Armstrongf548adc2023-09-08 15:59:42 -04001# -*- makefile -*-
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# -----------------------------------------------------------------------
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
26# JJB_DEBUG := true
27
28##-------------------##
29##---] TARGETS [---##
30##-------------------##
31all: help
32
33## -----------------------------------------------------------------------
34## Intent: Generate pipeline jobs
35## -----------------------------------------------------------------------
36.PHONY: jjb-gen
37
38jjb-gen-args := $(null)
39$(if $(JJB_DEBUG),$(eval jjb-gen-args += --log_level DEBUG))
40
41jjb-gen-log := $(jjb-gen-dir)/jjb-gen.log
42jjb-gen: $(venv-activate-script)
43
44 $(call banner-enter,Target $@)
45 @mkdir -p $(jjb-gen-dir)
46 @touch "$(jjb-gen-dir)/.sentinel"
47 ( \
48 $(activate) \
49 && jenkins-jobs $(jjb-gen-args) test $(PWD)/jjb -o $(jjb-gen-dir) 3>&1 2>&1 \
50 ) | tee "$(jjb-gen-log)"
51
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
62 $(call banner-leave,Target $@)
63
64## -----------------------------------------------------------------------
65## -----------------------------------------------------------------------
66sterile ::
67 $(RM) -r $(jjb-gen-dir)
68
69$(if $(DEBUG),$(warning LEAVE))
70
71# [EOF]