Skip to content

Commit

Permalink
auto deploy support for non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
codewithaloknath committed Dec 13, 2021
1 parent 608a076 commit 6a83854
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
30 changes: 17 additions & 13 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
# limitations under the License.
##
#!/bin/bash

mkdir -p /tmp/openlookeng
chmod 777 /tmp/openlookeng

export wget_url=https://download.openlookeng.io
declare openlk_version=
declare version_arr=
declare package_name=openlookeng.tar.gz
declare install_path=/opt/openlookeng
declare install_path=/tmp/openlookeng
declare DEFAULT_MAX_SPLITS_PER_NODE_VALUE=100
declare DEFAULT_MAX_PENDING_SPLITS_PER_TASK_VALUE=10
declare CLUSTER_PASS
Expand Down Expand Up @@ -201,16 +205,16 @@ function download()
URL="$wget_url/auto-install/$package_name"
if type wget &>/dev/null
then
echo "wget -O /opt/$package_name.sha256sum $URL.sha256sum"
wget -O /opt/$package_name.sha256sum $URL.sha256sum
echo "wget -O /opt/$package_name $URL"
wget -O /opt/$package_name $URL
echo "wget -O /tmp/$package_name.sha256sum $URL.sha256sum"
wget -O /tmp/$package_name.sha256sum $URL.sha256sum
echo "wget -O /tmp/$package_name $URL"
wget -O /tmp/$package_name $URL
elif type curl &>/dev/null
then
#wget -P . "$URL"
curl -fsSL -o /opt/$package_name.sha256sum $URL.sha256sum
echo "curl -fsSL -o /opt/$package_name $URL"
curl -fsSL -o /opt/$package_name $URL
curl -fsSL -o /tmp/$package_name.sha256sum $URL.sha256sum
echo "curl -fsSL -o /tmp/$package_name $URL"
curl -fsSL -o /tmp/$package_name $URL
fi
# download failed
if test $? -ne 0
Expand All @@ -223,7 +227,7 @@ function download()
function verify_unpack()
{
#1.check package
cd /opt &> /dev/null
cd /tmp &> /dev/null
echo "[INFO] Starting verification package..."
res=$(sha256sum -c ${package_name}.sha256sum|grep OK|wc -l)
if [[ $res > 0 ]]
Expand All @@ -236,8 +240,8 @@ function verify_unpack()
fi
#cd - &> /dev/null
#2.extracting package
echo "[INFO] Extracting package ${package_name} to /opt ..."
tar -zxvf $package_name -C /opt &> /dev/null
echo "[INFO] Extracting package ${package_name} to /tmp ..."
tar -zxvf $package_name -C /tmp &> /dev/null
if [[ $? != 0 ]]
then
exit 1
Expand Down Expand Up @@ -333,8 +337,8 @@ function create_user()
#bash $OPENLOOKENG_BIN_THIRD_PATH/hetu_adduser.sh # will create user before
continue
else
. $OPENLOOKENG_BIN_THIRD_PATH/cpresource_remote.sh $ip $OPENLOOKENG_BIN_THIRD_PATH/hetu_adduser.sh /opt
. $OPENLOOKENG_BIN_THIRD_PATH/execute_remote.sh $ip "bash /opt/hetu_adduser.sh;rm -rf /opt/hetu_adduser.sh;exit"
. $OPENLOOKENG_BIN_THIRD_PATH/cpresource_remote.sh $ip $OPENLOOKENG_BIN_THIRD_PATH/hetu_adduser.sh /tmp
. $OPENLOOKENG_BIN_THIRD_PATH/execute_remote.sh $ip "bash /tmp/hetu_adduser.sh;rm -rf /tmp/hetu_adduser.sh;exit"
fi
done

Expand Down
4 changes: 2 additions & 2 deletions openlookeng/bin/auxiliary_tools/pathfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
# limitations under the License.
##
#bin/pathfile
INSTALL_PATH=/opt/openlookeng
INSTALL_PATH=/tmp/openlookeng
OPENLOOKENG_DEPENDENCIES_PATH=$INSTALL_PATH/resource
OEPNLKADMIN_PATH=/home/openlkadmin/.openlkadmin
CLUSTER_CONFIG_INFO=$OEPNLKADMIN_PATH/cluster_config_info
CLUSTER_NODE_INFO=$OEPNLKADMIN_PATH/cluster_node_info
OPENLOOKENG_BIN_PATH=$INSTALL_PATH/bin
OPENLOOKENG_BIN_THIRD_PATH=$OPENLOOKENG_BIN_PATH/auxiliary_tools

export INSTALL_PATH OPENLOOKENG_DEPENDENCIES_PATH OEPNLKADMIN_PATH OPENLOOKENG_BIN_PATH OPENLOOKENG_BIN_THIRD_PATH
export INSTALL_PATH OPENLOOKENG_DEPENDENCIES_PATH OEPNLKADMIN_PATH OPENLOOKENG_BIN_PATH OPENLOOKENG_BIN_THIRD_PATH

0 comments on commit 6a83854

Please sign in to comment.