Joey Armstrong | af679da | 2023-01-31 14:22:41 -0500 | [diff] [blame] | 1 | #!/usr/bin/env groovy |
| 2 | // ----------------------------------------------------------------------- |
Joey Armstrong | 518f357 | 2024-02-11 07:56:25 -0500 | [diff] [blame] | 3 | // Copyright 2021-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | af679da | 2023-01-31 14:22:41 -0500 | [diff] [blame] | 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 Scandolo | 42f6e57 | 2021-01-25 15:11:34 -0800 | [diff] [blame] | 18 | def call(String project) { |
| 19 | // project is the gerrit project name |
| 20 | |
Matteo Scandolo | 231e2da | 2021-02-10 14:16:30 -0800 | [diff] [blame] | 21 | // 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 Scandolo | 42f6e57 | 2021-01-25 15:11:34 -0800 | [diff] [blame] | 40 | |
| 41 | sh """ |
Matteo Scandolo | 231e2da | 2021-02-10 14:16:30 -0800 | [diff] [blame] | 42 | make -C $WORKSPACE/${project} DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest ${makeTarget} |
Matteo Scandolo | 42f6e57 | 2021-01-25 15:11:34 -0800 | [diff] [blame] | 43 | """ |
| 44 | } else { |
| 45 | println "The project ${project} does not require to be built." |
| 46 | } |
| 47 | |
| 48 | } |
Joey Armstrong | af679da | 2023-01-31 14:22:41 -0500 | [diff] [blame] | 49 | |
| 50 | // [EOF] |