liuxunorg commented on a change in pull request #170: SUBMARINE-367. Support 
submarine configuration outside k8s
URL: https://github.com/apache/submarine/pull/170#discussion_r373454637
 
 

 ##########
 File path: submarine-cloud/hack/deploy-submarine.sh
 ##########
 @@ -0,0 +1,129 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+set -e
+
+ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd)
+cd $ROOT
+SUBMARINE_HOME=${ROOT}/..
+
+source $ROOT/hack/lib.sh
+
+hack::check_requirements
+
+# install submarine in k8s cluster
+function install_submarine() {
+  if [ ! -d "${ROOT}/hack/conf" ]; then
+    mkdir "${ROOT}/hack/conf"
+  fi
+
+  if [ ! -f "${ROOT}/hack/conf/submarine-site.xml" ]; then
+    cp "${SUBMARINE_HOME}/conf/submarine-site.xml.template" 
"${ROOT}/hack/conf/submarine-site.xml"
+
+    # Replace the mysql jdbc.url in the submarine-site.xml file with the name 
of the submarine database ip/service
+    sed -i.bak "s/127.0.0.1:3306/${DATABASE_IP}:3306/g" 
"${ROOT}/hack/conf/submarine-site.xml"
+  fi
+
+  if [ ! -f "${ROOT}/hack/conf/log4j.properties" ]; then
+    cp ${SUBMARINE_HOME}/conf/log4j.properties.template 
${ROOT}/hack/conf/log4j.properties
+  fi
+
+  echo ""
+  echo -e "Have you configured the 
\033[31m${ROOT}/hack/conf/submarine-site.xml\033[0m file?"
+  echo -e "Have you configured the 
\033[31m${ROOT}/hack/conf/log4j.properties\033[0m file?"
+  echo -n "Do you want to deploy submarine in k8s cluster now? [y/n]"
+  read myselect
+  if [[ "$myselect" == "y" || "$myselect" == "Y" ]]; then
+    if kubectl get configmap --namespace default | grep submarine-config 
>/dev/null ; then
 
 Review comment:
   Yes, I plan to complete the functions first, and then optimize.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to