Match-id-3fdc425ce739d29f9a9ac37dcdbad364e616755e

This commit is contained in:
BianTanggui
2020-10-14 11:57:20 +08:00
parent bbfd6bc5da
commit 252fe23bd3
3 changed files with 33 additions and 14 deletions

View File

@@ -74,9 +74,10 @@ function build_run_package()
mkdir run_pkg
/bin/cp -f {${RUNTIMESRCDIR},${HOOKSRCDIR},${INSTALLHELPERSRCDIR},${CLISRCDIR}}/build/ascend-docker* run_pkg
/bin/cp -f scripts/uninstall.sh run_pkg
FILECNT=`ls -l run_pkg |grep "^-"|wc -l`
echo "prepare package $FILECNT bins"
if [ $FILECNT -ne 4 ]; then
if [ $FILECNT -ne 5 ]; then
exit 1
fi

View File

@@ -14,9 +14,16 @@ function install()
cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime
cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook
cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli
cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper
chmod 550 ${INSTALL_PATH}/ascend-docker-runtime
chmod 550 ${INSTALL_PATH}/ascend-docker-hook
chmod 550 ${INSTALL_PATH}/ascend-docker-cli
chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper
mkdir -p ${INSTALL_PATH}/script
cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh
chmod 550 ${INSTALL_PATH}/script/uninstall.sh
echo 'install executable files success'
if [ ! -d "${DOCKER_CONFIG_DIR}" ]; then
@@ -45,22 +52,12 @@ function uninstall()
exit 0
fi
${INSTALL_PATH}/script/uninstall.sh
echo 'remove daemon.json setting success'
rm -rf ${INSTALL_PATH}
echo 'remove executable files success'
SRC="${DOCKER_CONFIG_DIR}/daemon.json.${PPID}"
DST="${DOCKER_CONFIG_DIR}/daemon.json"
if [ ! -f "${DST}" ]; then
exit 0
fi
./ascend-docker-plugin-install-helper rm ${DST} ${SRC}
if [ "$?" != "0" ]; then
echo 'ERROR: del damon.json failed'
exit 1
fi
mv ${SRC} ${DST}
echo 'del damom.json success'
}
@@ -76,9 +73,13 @@ function upgrade()
cp -f ./ascend-docker-runtime ${INSTALL_PATH}/ascend-docker-runtime
cp -f ./ascend-docker-hook ${INSTALL_PATH}/ascend-docker-hook
cp -f ./ascend-docker-cli ${INSTALL_PATH}/ascend-docker-cli
cp -f ./ascend-docker-plugin-install-helper ${INSTALL_PATH}/ascend-docker-plugin-install-helper
cp -f ./uninstall.sh ${INSTALL_PATH}/script/uninstall.sh
chmod 550 ${INSTALL_PATH}/ascend-docker-runtime
chmod 550 ${INSTALL_PATH}/ascend-docker-hook
chmod 550 ${INSTALL_PATH}/ascend-docker-cli
chmod 550 ${INSTALL_PATH}/ascend-docker-plugin-install-helper
chmod 550 ${INSTALL_PATH}/script/uninstall.sh
echo 'upgrade ascend docker runtime success'
}

View File

@@ -0,0 +1,17 @@
#!/bin/bash
ROOT=$(cd `dirname $0`; pwd)/..
DST='/etc/docker/daemon.json'
SRC="${DST}.${PPID}"
if [ ! -f "${DST}" ]; then
exit 0
fi
${ROOT}/ascend-docker-plugin-install-helper rm ${DST} ${SRC}
if [ "$?" != "0" ]; then
echo 'ERROR: del damon.json failed'
exit 1
fi
mv ${SRC} ${DST}