walle 2.0最新部署流程

时间:2022-12-29 11:30:27

环境

centos7
python3.6(yum install python3 python36-devel -y)
pip3(python3 -m pip install –upgrade pip)
mysql5.6(预先部署)
nginx1.22(预先部署)

特性

类gitlab的RESTful API,类gitlab的权限模型,将来打通gitlab,良心的惊喜
空间管理。意味着有独立的空间资源:环境管理、用户组、项目、服务器等
灰度发布。呼声不断,终于来了
websocket 实时展示部署中的 shell console
完善的通知机制。邮件、钉钉
全新的UI,我自己都被震憾到了,如丝般流畅

下载walle-web程序

官方文档:https://walle-web.io/docs/2/installation.htmlgithub地址:https://github.com/meolu/walle-web.git
或下载walle-web-2.0.1.tar.gz并解压(下载地址:https://github.com/meolu/walle-web)

mkdir /data/www
ln -s /data/www /www
chown www.www /data/www/
cd /software/walle-web
tar xf walle-web-2.0.1.tar.gz
mv walle-web-2.0.1 /www/walle-web2
chown www.www /www/walle-web2 -R

开始初始化

sed -i '/pip install virtualenv/c pip install virtualenv==20.16.6' admin.sh 
sed -i '/virtualenv --no-site-packages venv/c virtualenv -p /usr/bin/python3 venv ' admin.sh
sed -i '/MarkupSafe==1.0/c MarkupSafe==1.1.0' requirements/prod.txt
echo "gitdb2==2.0.6">>requirements/prod.txt
echo "greenlet==1.1.3">>requirements/prod.txt
sh admin.sh init
source venv/bin/activate
./venv/bin/pip install --upgrade setuptools==57.5.0
sh admin.sh init

配置nginx

cat > walle2.xxx.com.conf << EOF
upstream webservers {
server 0.0.0.0:5000 weight=1; # 负载设置
}
server {
listen 80;
server_name walle2.xxx.com; # 域名设置
access_log logs/walle2.xxx.com.access.log main;
index index.html index.htm; # 日志目录

location / {
try_files \$uri \$uri/ /index.html;
add_header access-control-allow-origin *;
root /www/walle-web2/fe; # 前端代码已集成到walle-web,即walle-web/fe的绝对路径
}

location ^~ /api/ {
add_header access-control-allow-origin *;
proxy_pass http://webservers;
proxy_set_header X-Forwarded-Host \$host:\$server_port;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header Origin \$host:\$server_port;
proxy_set_header Referer \$host:\$server_port;
}

location ^~ /socket.io/ {
add_header access-control-allow-origin *;
proxy_pass http://webservers;
proxy_set_header X-Forwarded-Host \$host:\$server_port;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header Origin \$host:\$server_port;
proxy_set_header Referer \$host:\$server_port;
proxy_set_header Host \$http_host;
proxy_set_header X-NginX-Proxy true;

# WebScoket Support
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
EOF

配置Hosts

cat >> /etc/hosts <<EOF
127.0.0.1 walle2.xxx.com # 与nginx配置一致
EOF

修改settings_prod.py配置

带 @TODO 就是可能要修改的地方
主要修改域名,mysql配置,邮箱

sed -i "/HOST =/c\    HOST = 'walle2.xxx.com'" walle/config/settings_prod.py
sed -i "/SQLALCHEMY_DATABASE_URI/c\ SQLALCHEMY_DATABASE_URI = 'mysql://walle2:walle2pwd@127.0.0.1:3306/walle2?charset=utf8'" walle/config/settings_prod.py
邮箱需要手动进入配置

创建数据库和用户

create database walle2;
grant all privileges on walle2.* to ‘walle2’@’%’ identified by ‘walle2pwd’;
flush privileges;

迁移数据Migration

sh admin.sh migration

启动

sh admin.sh start

登录

本地做好host解析,http://walle2.xxx.com/默认账号密码:
超管:super@walle-web.io \ Walle123
所有者:owner@walle-web.io \ Walle123
负责人:master@walle-web.io \ Walle123
开发者:developer@walle-web.io \ Walle123
访客:reporter@walle-web.io \ Walle123


walle 2.0最新部署流程



相关requirements.txt

alembic==1.4.3
amqp==1.4.9
aniso8601==9.0.1
anyjsnotallow==0.3.3
Babel==2.6.0
bcrypt==4.0.1
bidict==0.21.4
billiard==3.3.0.23
blinker==1.5
celery==3.1.18
certifi==2022.9.24
cffi==1.15.1
chardet==3.0.4
click==8.0.4
cryptography==38.0.1
eventlet==0.23.0
fabric2==2.3.1
Flask==1.0.2
Flask-Babel==0.11.2
Flask-Bcrypt==0.7.1
Flask-Login==0.4.0
Flask-Mail==0.9.0
Flask-Migrate==2.3.1
Flask-RESTful==0.3.5
Flask-SocketIO==3.0.2
Flask-SQLAlchemy==2.3.2
Flask-WTF==0.14.2
gevent==1.3.7
gevent-websocket==0.10.1
gitdb2==2.0.6
GitPythnotallow==2.1.11
greenlet==1.1.3
gunicorn==20.1.0
idna==2.7
importlib-metadata==4.8.3
invoke==1.7.3
itsdangerous==2.0.1
Jinja2==2.10
kombu==3.0.37
Mako==1.1.6
MarkupSafe==1.1.0
marshmallow==2.15.1
mysqlclient==1.3.13
paramiko==2.11.0
psycopg2==2.7.5
pycparser==2.21
pycrypto==2.6.1
PyNaCl==1.5.0
python-dateutil==2.8.2
python-editor==1.0.4
python-engineio==4.3.4
python-socketio==5.7.2
pytz==2015.6
requests==2.20.0
six==1.16.0
smmap==5.0.0
smmap2==3.0.1
SQLAlchemy==1.2.14
typing_extensinotallow==4.1.1
urllib3==1.24.3
Werkzeug==0.14
WTForms==2.1
zipp==3.6.0