blob: 69eaaee981c8e7f4a1b71ce0fa0580661dd416cc [file] [log] [blame]
Joey Armstrongaf679da2023-01-31 14:22:41 -05001#!/usr/bin/env groovy
2// -----------------------------------------------------------------------
3// Copyright 2021-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
Matteo Scandolo42f6e572021-01-25 15:11:34 -080018def call(String project) {
19 // project is the gerrit project name
20
Matteo Scandolo231e2da2021-02-10 14:16:30 -080021 // these are project that are not required to be built
22 def ignoredProjects = [
23 '', // this is the case for a manual trigger on master, nothing to be built
24 'voltha-system-tests',
25 'voltha-helm-charts'
26 ]
27
28 // some projects have different make targets
29 def Map customMakeTargets = [
30 "voltctl": "release"
31 ]
32
33 def defaultMakeTarget = "docker-build"
34
35 if (!ignoredProjects.contains(project)) {
36
37 def makeTarget = customMakeTargets.get(project, defaultMakeTarget)
38
39 println "Building ${project} with make target ${makeTarget}."
Matteo Scandolo42f6e572021-01-25 15:11:34 -080040
41 sh """
Matteo Scandolo231e2da2021-02-10 14:16:30 -080042 make -C $WORKSPACE/${project} DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest ${makeTarget}
Matteo Scandolo42f6e572021-01-25 15:11:34 -080043 """
44 } else {
45 println "The project ${project} does not require to be built."
46 }
47
48}
Joey Armstrongaf679da2023-01-31 14:22:41 -050049
50// [EOF]