projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding NG-LCM charm
[osm/devops.git]
/
tools
/
local-build.sh
diff --git
a/tools/local-build.sh
b/tools/local-build.sh
index
9f872d2
..
7254bad
100755
(executable)
--- a/
tools/local-build.sh
+++ b/
tools/local-build.sh
@@
-25,6
+25,7
@@
NO_CACHE=""
OPENSTACKRC="/var/snap/microstack/common/etc/microstack.rc"
REGISTRY="localhost:32000"
ROOTDIR="$( cd "${DIR}/../../" &> /dev/null && pwd)"
OPENSTACKRC="/var/snap/microstack/common/etc/microstack.rc"
REGISTRY="localhost:32000"
ROOTDIR="$( cd "${DIR}/../../" &> /dev/null && pwd)"
+DEVEL_TAG="devel"
OSM_TESTS_IMAGE_TAG="devel"
function check_arguments(){
OSM_TESTS_IMAGE_TAG="devel"
function check_arguments(){
@@
-32,6
+33,7
@@
function check_arguments(){
case $1 in
--debug) set -x ;;
--apt-proxy) APT_PROXY="$2" && shift ;;
case $1 in
--debug) set -x ;;
--apt-proxy) APT_PROXY="$2" && shift ;;
+ --devel-tag) DEVEL_TAG="$2" && shift ;;
--help | -h) show_help && exit 0 ;;
--httpddir) HTTPDIR="$2" && shift;;
--install-local-registry) 'install_local_registry' ;;
--help | -h) show_help && exit 0 ;;
--httpddir) HTTPDIR="$2" && shift;;
--install-local-registry) 'install_local_registry' ;;
@@
-172,7
+174,7
@@
function install_qhttpd() {
if [ ! -z $EXISTING_PID ] ; then
kill $EXISTING_PID
fi
if [ ! -z $EXISTING_PID ] ; then
kill $EXISTING_PID
fi
- qhttp -p ${HTTPPORT} &
+
nohup
qhttp -p ${HTTPPORT} &
}
function stage_2() {
}
function stage_2() {
@@
-226,8
+228,12
@@
function stage_2() {
exit 1
fi
done
exit 1
fi
done
-
- find . -name '*.deb' -exec mv -v {} ${HTTPDDIR}/ \;
+ for file in `find . -name '*.deb'` ; do
+ name=`basename ${file} | cut -d_ -f1`;
+ rm -v ~/snap/qhttp/common/${name}*
+ cp -v $file ~/snap/qhttp/common/${name}_$(date "+%H%M%S").deb
+ rm -v $file
+ done
done
}
done
}
@@
-260,7
+266,7
@@
function stage_3() {
HOSTIP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')
for file in ~/snap/qhttp/common/*.deb ; do
file=`basename ${file}`
HOSTIP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')
for file in ~/snap/qhttp/common/*.deb ; do
file=`basename ${file}`
- name=`echo ${file} | cut -d_ -f1 | sed "s/-/_/g"`;
+ name=`echo ${file} | cut -d_ -f1 | sed "s/-/_/g"
| sed "s/.deb//"
`;
name=${name^^}_URL
BUILD_ARGS="${BUILD_ARGS}--build-arg ${name}=http://$HOSTIP:${HTTPPORT}/$file "
echo Added ${name} as http://$HOSTIP:${HTTPPORT}/$file
name=${name^^}_URL
BUILD_ARGS="${BUILD_ARGS}--build-arg ${name}=http://$HOSTIP:${HTTPPORT}/$file "
echo Added ${name} as http://$HOSTIP:${HTTPPORT}/$file
@@
-275,7
+281,7
@@
function stage_3() {
print_section "Building ${MODULE}"
cd ${MODULE}
MODULE=${MODULE,,}
print_section "Building ${MODULE}"
cd ${MODULE}
MODULE=${MODULE,,}
- docker build ${NO_CACHE} -t opensourcemano/${MODULE}:
devel
${BUILD_ARGS} .
+ docker build ${NO_CACHE} -t opensourcemano/${MODULE}:
${DEVEL_TAG}
${BUILD_ARGS} .
if [ $? -ne 0 ] ; then
print_section "Failed to build ${MODULE}"
exit 1
if [ $? -ne 0 ] ; then
print_section "Failed to build ${MODULE}"
exit 1
@@
-301,8
+307,8
@@
function local_registry_push() {
fi
for MODULE in ${MODULES} ; do
MODULE=${MODULE,,}
fi
for MODULE in ${MODULES} ; do
MODULE=${MODULE,,}
- docker tag opensourcemano/${MODULE}:
devel ${REGISTRY}/opensourcemano/${MODULE}:devel
- docker push ${REGISTRY}/opensourcemano/${MODULE}:
devel
+ docker tag opensourcemano/${MODULE}:
${DEVEL_TAG} ${REGISTRY}/opensourcemano/${MODULE}:${DEVEL_TAG}
+ docker push ${REGISTRY}/opensourcemano/${MODULE}:
${DEVEL_TAG}
done
}
done
}
@@
-312,7
+318,7
@@
function install_osm() {
if juju controllers 2>/dev/null| grep osm-vca ; then
VCA="--vca osm-vca"
fi
if juju controllers 2>/dev/null| grep osm-vca ; then
VCA="--vca osm-vca"
fi
- ./charmed_install.sh --registry localhost:32000 --tag
devel
${VCA}
+ ./charmed_install.sh --registry localhost:32000 --tag
${DEVEL_TAG}
${VCA}
}
function start_robot() {
}
function start_robot() {
@@
-412,7
+418,7
@@
function update_osm_module() {
for MODULE in ${MODULES} ; do
MODULE=${MODULE,,}
echo "Updating ${MODULE}"
for MODULE in ${MODULES} ; do
MODULE=${MODULE,,}
echo "Updating ${MODULE}"
- juju attach-resource ${MODULE}
image=localhost:32000/opensourcemano/${MODULE}:devel
+ juju attach-resource ${MODULE}
${MODULE}-image=localhost:32000/opensourcemano/${MODULE}:${DEVEL_TAG}
done
}
done
}