This is an automated email from the ASF dual-hosted git repository.

ioleksandr pushed a commit to branch DLAB-3
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/DLAB-3 by this push:
     new ccc00a3  final fixes
ccc00a3 is described below

commit ccc00a3792f2808ece3800716aed9975b11033e1
Author: Oleksandr_Isniuk <i.oleksa...@gmail.com>
AuthorDate: Tue May 14 15:29:27 2019 +0300

    final fixes
---
 .../src/ssn/scripts/configure_docker.py            | 12 +++++-----
 .../src/ssn/templates/mysql.sh                     | 27 ----------------------
 2 files changed, 6 insertions(+), 33 deletions(-)

diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py 
b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
index 24867c4..18ac3d8 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
@@ -115,19 +115,19 @@ def configure_guacamole():
         sudo('cp initdb.sql /tmp/scripts')
         sudo('mkdir /opt/mysql')
         sudo('docker run --name guac-mysql --restart unless-stopped -v 
/tmp/scripts:/tmp/scripts '\
-             '-v /opt/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD={} -d 
mysql:latest'.format(mysql_pass))
+             ' -v /opt/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD={} -d 
mysql:latest'.format(mysql_pass))
         time.sleep(180)
         sudo('touch /opt/mysql/dock-query.sql')
         sudo("""echo "CREATE DATABASE guacamole; CREATE USER 'guacamole' 
IDENTIFIED BY '{}';"""\
-             """GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole.* TO 
'guacamole';" > /opt/mysql/dock-query.sql"""\
+             """ GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole.* TO 
'guacamole';" > /opt/mysql/dock-query.sql"""\
              .format(mysql_pass))
         sudo('docker exec -i guac-mysql /bin/bash -c "mysql -u root -p{} < 
/var/lib/mysql/dock-query.sql"'\
              .format(mysql_pass))
         sudo('docker exec -i guac-mysql /bin/bash -c "cat 
/tmp/scripts/initdb.sql | mysql -u root -p{} guacamole"'\
              .format(mysql_pass))
         sudo("docker run --name guacamole --restart unless-stopped --link 
guacd:guacd --link guac-mysql:mysql"\
-             "-e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e 
MYSQL_PASSWORD='guacamole'"\
-             "-d -p 8080:8080 guacamole/guacamole")
+             " -e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e 
MYSQL_PASSWORD='guacamole'"\
+             " -d -p 8080:8080 guacamole/guacamole")
         #create cronjob for run containers on reboot
         sudo('mkdir /opt/dlab/cron')
         sudo('touch /opt/dlab/cron/mysql.sh')
@@ -136,8 +136,8 @@ def configure_guacamole():
         sudo('echo "docker start guac-mysql" >> /opt/dlab/cron/mysql.sh')
         sudo('echo "docker rm guacamole" >> /opt/dlab/cron/mysql.sh')
         sudo("""echo "docker run --name guacamole --restart unless-stopped 
--link guacd:guacd --link guac-mysql:mysql"""\
-             """-e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e 
MYSQL_PASSWORD='{}' -d"""\
-             """-p 8080:8080 guacamole/guacamole" >> 
/opt/dlab/cron/mysql.sh""".format(mysql_pass))
+             """ -e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e 
MYSQL_PASSWORD='{}' -d"""\
+             """ -p 8080:8080 guacamole/guacamole" >> 
/opt/dlab/cron/mysql.sh""".format(mysql_pass))
         sudo('(crontab -l 2>/dev/null; echo "@reboot sh 
/opt/dlab/cron/mysql.sh") | crontab -')
         return True
     except Exception as err:
diff --git a/infrastructure-provisioning/src/ssn/templates/mysql.sh 
b/infrastructure-provisioning/src/ssn/templates/mysql.sh
deleted file mode 100644
index 09fddda..0000000
--- a/infrastructure-provisioning/src/ssn/templates/mysql.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/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.
-#
-# 
******************************************************************************
-
-docker start guacd
-docker start guac-mysql
-docker rm guacamole
-docker run --name guacamole --restart unless-stopped --link guacd:guacd --link 
guac-mysql:mysql -e MYSQL_DATABASE='guacamole' -e MYSQL_USER='guacamole' -e 
MYSQL_PASSWORD='MYSQL_GENERATED_PASS' -d -p 8080:8080 guacamole/guacamole
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org
For additional commands, e-mail: commits-h...@dlab.apache.org

Reply via email to