Giter Club home page Giter Club logo

opssystem's Introduction

OpsSystem

运维管理发布系统 Demo 地址: http://demo.hujingguang.cn username: guest 管理系统 password: 123123

#这是一个运维平台,使用bootstrap 和django 框架进行开发。目前实现了项目管理模块,发布Git和SVN代码库的php工程,回滚代码,以及集成Saltstack 进行应用批量部署模块和命令批量执行. 命令审计查询

前端模板下载地址: https://startbootstrap.com/

Docker Image 部署

docker pull hooversa/ops_system:latest

docker run --name ops_system --rm -p 80:81 -d hooversa/ops_system

浏览器打开 127.0.0.1 (用户名/密码: admin/helloworld)

服务器部署步骤,

1 :安装python2.7版本,CentOS6.x, django1.9框架 pexpect python模块,svn工具 git工具 Saltstack 自动化工具

2: pip install django==v1.9.0 && pip install pexpect && yum install git subversion -y && pip install salt==v2015.8.13

3: 进入工程根目录,配置好mysql数据库,执行python manage.py test 测试数据库连接

4: 初始化数据库表,python manage.py makemigrations && python manage.py migrate

5: 创建一个管理员账号, python manage.py createsuperuser ,(在该平台里,只有管理员才能发布工程到正式环境)

6: 第一次发布代码,需要初始化发布记录,直接在表ops_deploy_info 插入一条发布记录,版本号根据自己项目而定,发布到相应的环境需要初始换相应的target字段:如测试环境target为test,预生产环境为pre,正式环境target字段为online. 7: 如果发布到正式环境,需配置ssh秘钥登陆,发布密码为管理员密码。发布到测试环境或预发布环境,密码为机器的root密码

8: 运行平台 python manage.py runserver 0.0.0.0:80

9: 如果要进行应用部署,请将项目根目录下的sls目录里面的所有文件拷贝至salt的file_root 下面,一般为/srv/salt 下面。如果要部署tomcat应用,请自行下载jdk源码包,放在/srv/salt/tomcat/files下面,并修改install.sls文件.

10: 要进行应用部署,需要安装minion客户端,并配置好master 和id ,还有必须在grains 添加三个变量:group,area,usage。 这个三个变量信息会在主机信息中对应:组,地址,和用途三栏。否则刷新无法获取到主机信息

11: 命令审计模块需要在各个salt-minion端安装agent.py,该文件位于项目下tools文件夹中,在salt-master运行 master.py接受来自agent.py的数据。,master.py需要配置数据库连接信息。直接编辑文件添加即可.

git clone https://github.com/hujingguang/OpsSystem.git

cd OpsSystem && cat INSTALL

-----Demo 地址:

http://demo.hujingguang.cn

username: guest

password: 123123

Screenshots


登陆界面

Dashboard

用户管理

用户添加

添加SVN版本库项目

添加Git版本库项目

发布工程

代码回滚

主机信息

应用部署

命令执行

应用部署记录

命令执行记录

云资产信息

文件下载

命令审计

集成脚本代码发布

opssystem's People

Contributors

hujingguang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opssystem's Issues

添加svn库地址长度限制问题

你好,修改了OpsSystem/deploy/forms.py中以下的代码,将max_length改为255了,但是提交表单时svn库地址长度仍是原来的40个字符,请问是我修改方法有问题吗?
repoAddress=forms.CharField(error_messages={'required':u'请输入库地址'},
label=u'SVN库地址',
max_length=255,
required=True,
widget=forms.TextInput(attrs={'class':'form-control','placeholder':'svn://192.168.16.1/repo/trunk'}))

主机定义

ALLOWED_HOSTS = [ ],请问这里定义的格式怎么设置,谢谢

发布失败,无法获取最新代码

我初次发布时,在ops数据库中手动插入了一条数据
insert into ops_deploy_info(repoName,target,revision,person,date,log) ,其中svn仓库的版本号使用了一个老版本号(145),但发布时仍提示”发布失败!! 无法获取最新代码“,请问是我哪里配置不对吗?
insert into ops_deploy_info(repoName,target,revision,person,date,log) values('game','test',145,'admin','2017-04-23 13:33:00','add init data');

install脚本有问题

安装好之后,yum,pip,setuptools,python都不能正常运行了;
节选一部分错误:
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/vcs/subversion.py", line 9, in
from pip.index import Link
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/index.py", line 29, in
from pip.wheel import Wheel, wheel_ext
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/wheel.py", line 39, in
from pip._vendor.distlib.scripts import ScriptMaker
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/_vendor/distlib/scripts.py", line 14, in
from .compat import sysconfig, detect_encoding, ZipFile
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/_vendor/distlib/compat.py", line 31, in
from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler
Traceback (most recent call last):
File "/usr/local/python2.7/bin/pip", line 9, in
load_entry_point('pip==8.0.2', 'console_scripts', 'pip')()
File "build/bdist.linux-x86_64/egg/pkg_resources/init.py", line 542, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/init.py", line 2569, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/init.py", line 2229, in load
File "build/bdist.linux-x86_64/egg/pkg_resources/init.py", line 2235, in resolve
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/init.py", line 15, in
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/vcs/subversion.py", line 9, in
from pip.index import Link
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/index.py", line 29, in
from pip.wheel import Wheel, wheel_ext
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/wheel.py", line 39, in
from pip._vendor.distlib.scripts import ScriptMaker
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/_vendor/distlib/scripts.py", line 14, in
from .compat import sysconfig, detect_encoding, ZipFile
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/_vendor/distlib/compat.py", line 31, in
from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler
Traceback (most recent call last):
File "/usr/local/python2.7/bin/pip", line 9, in
load_entry_point('pip==8.0.2', 'console_scripts', 'pip')()
File "build/bdist.linux-x86_64/egg/pkg_resources/init.py", line 542, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/init.py", line 2569, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources/init.py", line 2229, in load
File "build/bdist.linux-x86_64/egg/pkg_resources/init.py", line 2235, in resolve
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/init.py", line 15, in
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/vcs/subversion.py", line 9, in
from pip.index import Link
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/index.py", line 29, in
from pip.wheel import Wheel, wheel_ext
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/wheel.py", line 39, in
from pip._vendor.distlib.scripts import ScriptMaker
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/_vendor/distlib/scripts.py", line 14, in
from .compat import sysconfig, detect_encoding, ZipFile
File "/usr/local/python2.7/lib/python2.7/site-packages/pip-8.0.2-py2.7.egg/pip/_vendor/distlib/compat.py", line 31, in
from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler
install pexpect salt django MySQL-pytho is ok ....................................
install git subversion ...............................
install salt-master failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.