blob: 3563c490882dddfb542f8e0fed431293e8672d2e [file] [log] [blame]
# fetch the standard karaf bits
rm -f /tmp/${KARAF_TARFILE_NAME}
# get a small cell
source ${ONOS_ROOT}/tools/dev/bash_profile
cell borrow 60 1+0
scp /tmp/${KARAF_TARFILE_NAME}.gz sdn@[${OC1}]:/tmp/${KARAF_TARFILE_NAME}.gz
ssh sdn@${OC1} "
# unroll the base karaf
rm -rf karaf
mkdir karaf
cd karaf
tar xf /tmp/${KARAF_TARFILE_NAME}.gz
# add the extra ONOS default boot features
sed -i.old -e 's|kar/${KARAF_RELEASE_VERSION}.*$|${ADDED_BOOT_FEATURES}|' apache-karaf-${KARAF_RELEASE_VERSION}/etc/org.apache.karaf.features.cfg
# run karaf to fill the maven repo with required artifacts
apache-karaf-${KARAF_RELEASE_VERSION}/bin/karaf server 1>/tmp/onos.out 2>/tmp/onos.err &
sleep 30
# stop karaf and capture the artifacts that were downloaded into the maven repo
apache-karaf-${KARAF_RELEASE_VERSION}/bin/karaf stop 1>/tmp/onos.out 2>/tmp/onos.err &
cd ~/.m2/repository
tar cvf ~/repo.tar *
# start with a fresh karaf and overlay the downloaded artifacts
rm -rf karaf-offline
mkdir karaf-offline
cd karaf-offline
tar xf /tmp/${KARAF_TARFILE_NAME}.gz
# load the downloaded artifacts into the karaf system directory
cd apache-karaf-${KARAF_RELEASE_VERSION}/system
tar xf ~/repo.tar
# create a zipped tar ball of the updated karaf tree
cd ~/karaf-offline
tar czf ~/karaf-offline.tar.gz apache-karaf-${KARAF_RELEASE_VERSION}
# fetch the new offline karaf tar ball
BUILD_NUMBER="${KARAF_RELEASE_VERSION}-offline-$(date +'%Y%m%d')"
scp sdn@[${OC1}]:karaf-offline.tar.gz /tmp/${BUILD_NUMBER}.tar.gz
cell return