初始化代码

This commit is contained in:
高山 2018-04-08 11:08:29 +08:00
parent 46332ce966
commit a3b1f99248
16 changed files with 54 additions and 69 deletions

View File

@ -46,7 +46,6 @@ type Project struct {
Orgalorg int16 // 不填
HostGroup string // 不填
Gzip int16 // 不填
PmsProName string //选填 发布系统关联
}
type Task struct {

22
control
View File

@ -1,4 +1,6 @@
#!/bin/bash -e
#golang相关参数
export GOROOT=/usr/local/go
export PATH=$PATH:/usr/local/go/bin/
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@ -102,6 +104,16 @@ function run() {
./$BASENAME -docker
#go run main.go
}
function rundocker() {
cd src/
./$BASENAME -docker
#go run main.go
}
function init() {
cd src/
./$BASENAME -init
#go run main.go
}
function beerun() {
cd src/
bee run
@ -124,7 +136,7 @@ function sslkey() {
function help() {
echo "$0 build|start|stop|kill|restart|reload|run|tail|docs|pack|beerun|sslkey"
echo "$0 build|start|stop|kill|restart|reload|run|rundocker|init|tail|docs|pack|beerun|sslkey"
}
if [ "$1" == "" ]; then
help
@ -145,7 +157,11 @@ elif [ "$1" == "reload" ];then
elif [ "$1" == "status" ];then
status
elif [ "$1" == "run" ];then
run
run
elif [ "$1" == "rundocker" ];then
rundocker
elif [ "$1" == "init" ];then
init
elif [ "$1" == "beerun" ];then
beerun
elif [ "$1" == "tail" ];then
@ -158,4 +174,4 @@ else
help
fi
#bee api gopub -driver=mysql -conn="mysql:mysql888@tcp(192.168.143.62:3306)/walle"
#bee api uwrok-api -driver=mysql -conn="mysql:mysql888@tcp(127.0.0.1:3306)/wf_workflow1"

View File

@ -15,17 +15,7 @@ func (c *TestApiController) Get() {
var projects []models.Project
o := orm.NewOrm()
o.Raw("SELECT * FROM `project` WHERE 1=1").QueryRows(&projects)
for _, v := range projects {
if v.PmsProName != "" {
var projectGits []orm.Params
ss, err := o.Raw("SELECT id,name FROM pms.project_git WHERE `name`=?", v.PmsProName).Values(&projectGits)
if err == nil && ss > 0 {
v.PmsProName = common.GetString(projectGits[0]["id"])
if v.PmsProName != "" {
err = models.UpdateProjectById(&v)
}
}
}
}
c.Data["json"] = projects
c.ServeJSON()
}

View File

@ -137,6 +137,8 @@ func main() {
beego.Info(beego.BConfig.RunMode)
if beego.BConfig.RunMode != "docker" {
init_sever.Start()
}else if beego.BConfig.RunMode != "init" {
}
beego.Run()
}

View File

@ -34,12 +34,10 @@ type Project struct {
PostRelease string `orm:"column(post_release);null"`
LastDeploy string `orm:"column(last_deploy);null"`
Audit int16 `orm:"column(audit);null"`
Ansible int16 `orm:"column(ansible)"`
KeepVersionNum int `orm:"column(keep_version_num)"`
CreatedAt time.Time `orm:"column(created_at);type(datetime);null"`
UpdatedAt time.Time `orm:"column(updated_at);type(datetime);null"`
P2p int16 `orm:"column(p2p)"`
Orgalorg int16 `orm:"column(orgalorg)"`
HostGroup string `orm:"column(host_group)"`
Gzip int16 `orm:"column(gzip)"`
PmsProName string `orm:"column(pms_pro_name);size(200)"`

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,i){for(var u,a,f,s=0,l=[];s<t.length;s++)a=t[s],o[a]&&l.push(o[a][0]),o[a]=0;for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(e[u]=c[u]);for(r&&r(t,c,i);l.length;)l.shift()();if(i)for(s=0;s<i.length;s++)f=n(n.s=i[s]);return f};var t={},o={3:0};n.e=function(e){function r(){u.onerror=u.onload=null,clearTimeout(a);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var t=o[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var c=new Promise(function(n,r){t=o[e]=[n,r]});t[2]=c;var i=document.getElementsByTagName("head")[0],u=document.createElement("script");u.type="text/javascript",u.charset="utf-8",u.async=!0,u.timeout=12e4,n.nc&&u.setAttribute("nonce",n.nc),u.src=n.p+"static/js/"+{0:"8ff15b8f",1:"f2271eda",2:"f3a45601"}[e]+".js";var a=setTimeout(r,12e4);return u.onerror=u.onload=r,i.appendChild(u),c},n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/",n.oe=function(e){throw console.error(e),e}}([]);
!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,i){for(var u,a,f,s=0,l=[];s<t.length;s++)a=t[s],o[a]&&l.push(o[a][0]),o[a]=0;for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(e[u]=c[u]);for(r&&r(t,c,i);l.length;)l.shift()();if(i)for(s=0;s<i.length;s++)f=n(n.s=i[s]);return f};var t={},o={3:0};n.e=function(e){function r(){u.onerror=u.onload=null,clearTimeout(a);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var t=o[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var c=new Promise(function(n,r){t=o[e]=[n,r]});t[2]=c;var i=document.getElementsByTagName("head")[0],u=document.createElement("script");u.type="text/javascript",u.charset="utf-8",u.async=!0,u.timeout=12e4,n.nc&&u.setAttribute("nonce",n.nc),u.src=n.p+"static/js/"+{0:"9f82f3b1",1:"90175b91",2:"5fe3621a"}[e]+".js";var a=setTimeout(r,12e4);return u.onerror=u.onload=r,i.appendChild(u),c},n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/",n.oe=function(e){throw console.error(e),e}}([]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

23
src/static/js/90175b91.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<!DOCTYPE html><html><head><meta http-equiv=Content-Type content="text/html; charset=UTF-8"><title>卷皮自动发布系统</title><meta name=Keywords content=卷皮自动发布系统><meta name=Description content=卷皮自动发布系统><meta http-equiv=X-UA-Compatible content="IE=Edge,chrome=1"><link rel="shortcut icon" href=/favicon.ico><link href=/static/css/bdafb859.css rel=stylesheet></head><body><mainbody></mainbody><script type=text/javascript src=/static/js/02c08a4b.js></script><script type=text/javascript src=/static/js/f2271eda.js></script><script type=text/javascript src=/static/js/f3a45601.js></script></body></html>
<!DOCTYPE html><html><head><meta http-equiv=Content-Type content="text/html; charset=UTF-8"><title>卷皮自动发布系统</title><meta name=Keywords content=卷皮自动发布系统><meta name=Description content=卷皮自动发布系统><meta http-equiv=X-UA-Compatible content="IE=Edge,chrome=1"><link rel="shortcut icon" href=/favicon.ico><link href=/static/css/d9b825ef.css rel=stylesheet></head><body><mainbody></mainbody><script type=text/javascript src=/static/js/57f55e70.js></script><script type=text/javascript src=/static/js/90175b91.js></script><script type=text/javascript src=/static/js/5fe3621a.js></script></body></html>

View File

@ -246,9 +246,7 @@ README.md" style="width: 400px;"></el-input>
Status: 1,
RepoMode: "branch",
Audit: 0,
Ansible: 1,
P2p: 0,
Orgalorg: 0,
Gzip: 1
},
route_id: this.$route.params.id,