blob: e6b653edf4b3241e4cd5e42d1d91a0b0265c1dd9 [file] [log] [blame]
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Builds a set of projects using ONOS archetypes.
4# -----------------------------------------------------------------------------
5
Ayaka Koshibef17f34a2015-09-24 19:31:48 -07006function _usage () {
7cat << _EOF_
8usage:
9 $(basename $0)
10
11summary:
12 Builds a set of projects using ONOS archetypes.
13
14_EOF_
15}
16
17[ "$1" = "-h" ] && _usage && exit 0
18
Brian O'Connor726dc5b2015-09-05 00:13:07 -070019set -e
20
HIGUCHI Yutafdfdb702016-02-25 11:18:22 -080021export AROOT=${ONOS_STAGE_ROOT:-/tmp}/foo
ONOS Jenkins User745873c2020-03-24 21:39:51 +000022export ARCHETYPE_OPTS="-DarchetypeGroupId=org.onosproject -DarchetypeVersion=2.2.2-SNAPSHOT"
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -080023
Ray Milkey670513d2020-03-24 14:04:21 -070024rm -fr $AROOT 2>/dev/null
Thomas Vachuskad9813e62015-01-21 08:43:04 -080025mkdir -p $AROOT
Ray Milkey670513d2020-03-24 14:04:21 -070026
Thomas Vachuskaa659f3d2020-03-23 16:17:06 -070027# FIXME: for an in api bundle cli rest ui uitab uitopo ui2; do
Thomas Vachuskab12adea2020-03-23 14:01:17 -070028for an in api bundle cli rest ui uitab uitopo; do
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -080029 cd $AROOT
Ray Milkey670513d2020-03-24 14:04:21 -070030 [ $an = api ] && name=foo-api || name=foo-app
Ray Milkey548768f2019-07-02 15:01:56 -070031 mvn -q -B archetype:generate "$@" $ARCHETYPE_OPTS \
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -080032 -DarchetypeArtifactId=onos-$an-archetype \
Ray Milkey670513d2020-03-24 14:04:21 -070033 -DgroupId=org.foo -DartifactId=$name -Dversion=1.0 \
34 -Dpackage=org.foo.test -DinteractiveMode=false
35 cd $AROOT/$name
Ray Milkey548768f2019-07-02 15:01:56 -070036 mvn "$@" -q -B clean install
Thomas Vachuskafc7f22d2014-12-04 11:07:01 -080037done