From 7eb111ba46fb943c6cdcf6c1b99659250b25b887 Mon Sep 17 00:00:00 2001 From: qitan Date: Mon, 13 May 2024 10:30:35 +0800 Subject: [PATCH] change the application --- .../rapidly-deployment-applets.yml | 52 ++++--------------- .../rapidly-enterprise-portal.yml | 11 ---- 2 files changed, 9 insertions(+), 54 deletions(-) diff --git a/documents/solution/internet-application-development/rapidly-deployment-applets.yml b/documents/solution/internet-application-development/rapidly-deployment-applets.yml index 5125cd6b..cc0772c6 100644 --- a/documents/solution/internet-application-development/rapidly-deployment-applets.yml +++ b/documents/solution/internet-application-development/rapidly-deployment-applets.yml @@ -200,12 +200,6 @@ Resources: Fn::Sub: |- #!/bin/bash - # script exit code: - # 0 - success - # 1 - unsupported system - # 2 - network not available - # 3 - failed install uwsgi - # 环境变量配置 export PATH=/usr/local/bin:$PATH @@ -246,7 +240,7 @@ Resources: log_info "$cmd, exit code: $ret" return $ret } - + function check_network_available() { log_info "ping $NETWORK_CHECk_ADDR ..." if ! debug_exec ping -c 4 $NETWORK_CHECk_ADDR; then @@ -254,10 +248,9 @@ Resources: fi } - function install_uwsgi() { - log_info "install uwsgi" - mkdir /data && cd /data - pip3 install uwsgi + function install_java() { + log_info "install java" + yum upgrade & yum install java-1.8.0-openjdk-devel -y } function init_database() { @@ -273,39 +266,8 @@ Resources: echo "" check_network_available - if ! debug_exec install_uwsgi; then - log_fatal 3 "install uwsgi failed" - fi - - cat << EOF > /data/uwsgi.ini - [uwsgi] - # uwsgi启动时所使用的地址和端口 - http=0.0.0.0:80 - # 指向网站目录 - chdir=/data - - # python启动程序文件 - wsgi-file=/data/main.py - # python程序内用以启动的application变量名 - callable=app - - # 处理器数 - processes=1 - - # 线程数 - threads=2 - - # 状态检测地址 - stats=127.0.0.1:9191 - - # 保存启动之后主进程的pid - pidfile=/data/uwsgi.pid - - # 设置uwsgi后台运行,uwsgi.log保存日志信息 自动生成 - daemonize=/data/uwsgi.log - - EOF + mkdir /data cat << "EOF" > /data/script.sql -- script.sql USE applets; @@ -328,6 +290,10 @@ Resources: EOF + if ! debug_exec install_java; then + log_fatal 3 "install java failed" + fi + if ! debug_exec init_database; then log_fatal 4 "init database failed" fi diff --git a/documents/solution/internet-application-development/rapidly-enterprise-portal.yml b/documents/solution/internet-application-development/rapidly-enterprise-portal.yml index 545c0877..c86f60d9 100644 --- a/documents/solution/internet-application-development/rapidly-enterprise-portal.yml +++ b/documents/solution/internet-application-development/rapidly-enterprise-portal.yml @@ -162,9 +162,6 @@ Resources: # 环境变量配置 export PATH=/usr/local/bin:$PATH - # 网络检查地址 - NETWORK_CHECk_ADDR="raw.githubusercontent.com" - function unsupported_system() { log_fatal 1 "Unsupported System: $1" } @@ -194,13 +191,6 @@ Resources: return $ret } - function check_network_available() { - log_info "ping $NETWORK_CHECk_ADDR ..." - if ! debug_exec ping -c 4 $NETWORK_CHECk_ADDR; then - log_fatal 2 "Could not connect to https://$NETWORK_CHECk_ADDR" - fi - } - function install_java() { log_info "install java" yum upgrade & yum install java-1.8.0-openjdk-devel -y @@ -212,7 +202,6 @@ Resources: fi; echo "" - check_network_available if ! debug_exec install_java; then log_fatal 3 "install java failed" fi