blob: 76b0fd1e502ab2179e76c519e54e5b92005dbf5e [file] [log] [blame]
Ray Milkey594add72016-11-15 14:36:26 -08001#!/bin/bash
2
Jon Hallb84df5d2017-01-31 11:19:48 -08003KARAF_VERSION="3.0.8"
Ray Milkey594add72016-11-15 14:36:26 -08004KARAF_TARFILE_NAME="apache-karaf-${KARAF_VERSION}.tar"
5BOOT_FEATURES="standard,ssh,scr,war,webconsole"
6
7# fetch the standard karaf bits
8rm -f /tmp/${KARAF_TARFILE_NAME}
9curl -o /tmp/${KARAF_TARFILE_NAME}.gz http://onlab.vicci.org/onos/third-party/${KARAF_TARFILE_NAME}.gz
10
11# get a small cell
12source ${ONOS_ROOT}/tools/dev/bash_profile
13cell borrow 60 1+0
14scp /tmp/${KARAF_TARFILE_NAME}.gz sdn@${OC1}:/tmp/${KARAF_TARFILE_NAME}.gz
15
16ssh sdn@${OC1} "
17
18 # unroll the base karaf
19 rm -rf karaf
20 mkdir karaf
21 cd karaf
22 tar xf /tmp/${KARAF_TARFILE_NAME}.gz
23
24 # set the ONOS default boot features
25 perl -pi.old -e 's|^(featuresBoot=).*|\1${BOOT_FEATURES}|' apache-karaf-${KARAF_VERSION}/etc/org.apache.karaf.features.cfg
26
27 # run karaf to fill the maven repo with required artifacts
28 apache-karaf-${KARAF_VERSION}/bin/karaf server 1>/tmp/onos.out 2>/tmp/onos.err &
29
30 sleep 15
31
32 # stop karaf and capture the artifacts that were downloaded into the maven repo
33 apache-karaf-${KARAF_VERSION}/bin/karaf stop 1>/tmp/onos.out 2>/tmp/onos.err &
34 cd ~/.m2/repository
35 tar cvf ~/repo.tar *
36
37 # start with a fresh karaf and overlay the downloaded artifacts
38 cd
39 rm -rf karaf-offline
40 mkdir karaf-offline
41 cd karaf-offline
42 tar xf /tmp/${KARAF_TARFILE_NAME}.gz
43
44 # load the downloaded artifacts into the karaf system directory
45 cd apache-karaf-${KARAF_VERSION}/system
46 tar xf ~/repo.tar
47
48 # create a zipped tar ball of the updated karaf tree
49 cd ~/karaf-offline
50 tar czf ~/karaf-offline.tar.gz apache-karaf-${KARAF_VERSION}
51"
52
53# fetch the new offline karaf tar ball
54BUILD_NUMBER="apache-karaf-${KARAF_VERSION}-offline-$(date +'%Y%m%d')"
55scp sdn@${OC1}:karaf-offline.tar.gz /tmp/${BUILD_NUMBER}.tar.gz
56
57cell return
58
59
60
61
62
63