1 Star 0 Fork 0

Da yang/Devops

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
modes.py 2.98 KB
一键复制 编辑 原始数据 按行查看 历史
Da yang 提交于 2021-03-08 20:39 . Initial commit
# coding=utf-8
import datetime
from utils import db
class Hosts(db.Model):
id = db.Column(db.Integer, autoincrement=True, primary_key=True)
hostname = db.Column(db.String(50))
ipaddr = db.Column(db.String(50))
Groups = db.Column(db.String(50))
Desc = db.Column(db.String(50))
username = db.Column(db.String(50))
passwd = db.Column(db.String(50))
port = db.Column(db.String(50))
check = db.Column(db.String(10), default="off")
def to_json(self):
dict = self.__dict__
if "_sa_instance_state" in dict:
del dict["_sa_instance_state"]
return dict
class projects(db.Model):
id = db.Column(db.Integer, autoincrement=True, primary_key=True)
project = db.Column(db.String(20))
repo = db.Column(db.String(100))
env = db.Column(db.String(100))
path = db.Column(db.String(200))
zip = db.Column(db.String(20))
servers = db.Column(db.String(200))
class DeployTask(db.Model):
id = db.Column(db.Integer, autoincrement=True, primary_key=True)
uid = db.Column(db.String(100), primary_key=True)
# UID标识如: gw-dev-2010
project = db.Column(db.String(100))
tag = db.Column(db.String(20))
status = db.Column(db.String(20), default="待发布")
before_download = db.Column(db.String(3000))
after_download = db.Column(db.String(3000))
before_deploy_sc = db.Column(db.String(3000))
after_deploy_sc = db.Column(db.String(3000))
versioninfo = db.Column(db.String(1000))
class scTemp(db.Model):
id = db.Column(db.Integer, autoincrement=True, primary_key=True)
title = db.Column(db.String(100))
scripts = db.Column(db.String(500))
desc = db.Column(db.String(100))
class Logs(db.Model):
id = db.Column(db.Integer, autoincrement=True, primary_key=True)
operator = db.Column(db.String(50))
uid = db.Column(db.String(100), primary_key=True)
types = db.Column(db.String(50))
runtime = db.Column(db.DateTime, default=datetime.datetime.now())
script = db.Column(db.String(2000))
result = db.Column(db.String(2000))
class middle(db.Model):
id = db.Column(db.Integer, autoincrement=True, primary_key=True)
source = db.Column(db.String(200))
desc = db.Column(db.String(200))
type = db.Column(db.String(30))
class Node(db.Model):
id = db.Column(db.Integer, autoincrement=True, primary_key=True)
task = db.Column(db.String(50)) # 发布 任务
text = db.Column(db.String(50)) # 节点文字
status = db.Column(db.String(50), default='lightgray') # 节点状态
parent = db.Column(db.String(50), nullable=True) # 父接点
servers = db.Column(db.String(50), nullable=True)
def to_json(self):
dict = self.__dict__
if "_sa_instance_state" in dict:
del dict["_sa_instance_state"]
return dict
class sysoptions(db.Model):
id = db.Column(db.Integer, autoincrement=True, primary_key=True)
values = db.Column(db.String(20))
types = db.Column(db.String(50))
desc = db.Column(db.String(200))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shyanglin/Devops.git
git@gitee.com:shyanglin/Devops.git
shyanglin
Devops
Devops
master

搜索帮助