GithubHelp home page GithubHelp logo

linclin / gopub Goto Github PK

View Code? Open in Web Editor NEW
1.4K 1.4K 398.0 15.14 MB

vue.js(element框架)+golang(beego框架)开发的运维发布系统,支持git,jenkins版本发布,go ssh,BT两种文件传输方式选择,支持部署前准备任务和部署后任务钩子函数

License: Apache License 2.0

Go 52.68% Shell 1.11% Smarty 0.56% JavaScript 7.98% Vue 36.15% CSS 1.07% HTML 0.08% Dockerfile 0.36%

gopub's People

Contributors

dependabot[bot] avatar gaoyue1989 avatar linclin avatar liuchenrang avatar pixcai avatar suzupy 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  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

gopub's Issues

ssh port指定

您好,请问下ssh 端口非22,在哪可以改? 需要修改源码?

请问你们使用gopub 发布过golang 程序吗?

你好,请问你们使用gopub 发布过golang 的程序吗?现在我们使用gopub的工程中,遇到的问题是,我们所有的项目都在一个github地址下面,里面包含了多个小的golang 程序,发布的时候,不知道怎么处理?而且你们的程序里面没有golang 程序的编译部分,这个有没有已经写好的推荐脚本了?

部署时报错

/data/web/gopub/src/github.com/astaxie/beego/tree.go:144:9: expected operand, found 'range'
/data/web/gopub/src/github.com/astaxie/beego/tree.go:149:4: expected '{', found 'if'
/data/web/gopub/src/github.com/astaxie/beego/tree.go:203:34: expected ')', found 'IDENT' string
/data/web/gopub/src/github.com/astaxie/beego/tree.go:257:10: expected operand, found 'range'
/data/web/gopub/src/github.com/astaxie/beego/tree.go:262:5: expected '{', found 'if'
/data/web/gopub/src/github.com/astaxie/beego/tree.go:286:30: expected ')', found 'IDENT' string
/data/web/gopub/src/github.com/astaxie/beego/tree.go:294:1: expected 1 expression
/data/web/gopub/src/github.com/astaxie/beego/tree.go:294:30: expected ')', found 'IDENT' string
/data/web/gopub/src/github.com/astaxie/beego/tree.go:295:2: expected ']', found 'if'
/data/web/gopub/src/github.com/astaxie/beego/tree.go:295:5: expected ';', found 'IDENT' len
/data/web/gopub/src/github.com/astaxie/beego/tree.go:389:45: expected operand, found ']'
/data/web/gopub/src/golang.org/x/net/webdav/prop.go:110:40: expected '}', found ':'
/data/web/gopub/src/golang.org/x/net/webdav/prop.go:171:2: expected declaration, found 'if'
/data/web/gopub/src/golang.org/x/net/webdav/prop.go:182:2: expected declaration, found 'if'
/data/web/gopub/src/golang.org/x/net/webdav/prop.go:230:2: expected declaration, found 'if'
/data/web/gopub/src/golang.org/x/net/webdav/prop.go:353:3: expected declaration, found 'IDENT' xml
/data/web/gopub/src/golang.org/x/net/webdav/prop.go:395:2: expected declaration, found 'IDENT' n

运行一段时间以后无法上线,报mysql错误。

2019/01/18 15:58:48 [I] [base.go:353] [{0 127.0.0.1 cd /root/gopubfakegit/release/fakegit/  && rm -f /root/gopubfakegit/release/fakegit/*.tar.gz && rm -rf /root/gopubfakegit/release/fakegit/20190116-114418    2019-01-18 15:58:48.310589532 +0800 CST m=+594667.324144406 2019-01-18 15:58:48.326845324 +0800 CST m=+594667.340399867 <nil> }] 
[ORM]2019/01/18 15:58:48  -[Queries/default] - [  OK / db.QueryRow /     2.7ms] - [SELECT `id`, `user_id`, `task_id`, `status`, `action`, `command`, `duration`, `memo`, `created_at` FROM `record` WHERE `id` = ? ] - `1268`
[ORM]2019/01/18 15:58:48  -[Queries/default] - [  OK / db.QueryRow /     2.8ms] - [SELECT `id`, `user_id`, `task_id`, `status`, `action`, `command`, `duration`, `memo`, `created_at` FROM `record` WHERE `id` = ? ] - `1268`
[ORM]2019/01/18 15:58:48  -[Queries/default] - [  OK /     db.Exec /     5.9ms] - [UPDATE `record` SET `user_id` = ?, `task_id` = ?, `status` = ?, `action` = ?, `command` = ?, `duration` = ?, `memo` = ?, `created_at` = ? WHERE `id` = ?] - `3`, `67`, `1`, `0`, `cd /root/gopubfakegit/release/fakegit/  && rm -f /root/gopubfakegit/release/fakegit/*.tar.gz && rm -rf /root/gopubfakegit/release/fakegit/20190116-114418`, `0`, `[{"Id":0,"Host":"127.0.0.1","Command":"cd /root/gopubfakegit/release/fakegit/  \u0026\u0026 rm -f /root/gopubfakegit/release/fakegit/*.tar.gz \u0026\u0026 rm -rf /root/gopubfakegit/release/fakegit/20190116-114418","LocalFilePath":"","RemoteFilePath":"","Result":"","StartTime":"2019-01-18T15:58:48.310589532+08:00","EndTime":"2019-01-18T15:58:48.326845324+08:00","Error":null,"ErrorInfo":""}]`, `1547798328`, `1268`
Number of records updated in database: 1
[ORM]2019/01/18 15:58:48  -[Queries/default] - [  OK /     db.Exec /     4.5ms] - [UPDATE `task` SET `enable_rollback`='0' WHERE`id` not in (67) and  project_id = ? and  `enable_rollback`=1 ] - `14`
[ORM]2019/01/18 15:58:48  -[Queries/default] - [  OK / db.QueryRow /     1.4ms] - [SELECT `id`, `user_id`, `name`, `level`, `status`, `version`, `repo_url`, `repo_username`, `repo_password`, `repo_mode`, `repo_type`, `deploy_from`, `excludes`, `release_user`, `release_to`, `release_library`, `hosts`, `pre_deploy`, `post_deploy`, `pre_release`, `post_release`, `last_deploy`, `audit`, `keep_version_num`, `created_at`, `updated_at`, `p2p`, `host_group`, `gzip`, `is_group`, `pms_pro_name` FROM `project` WHERE `id` = ? ] - `14`
[ORM]2019/01/18 15:58:48  -[Queries/default] - [FAIL /     db.Exec /     1.6ms] - [UPDATE `project` SET `user_id` = ?, `name` = ?, `level` = ?, `status` = ?, `version` = ?, `repo_url` = ?, `repo_username` = ?, `repo_password` = ?, `repo_mode` = ?, `repo_type` = ?, `deploy_from` = ?, `excludes` = ?, `release_user` = ?, `release_to` = ?, `release_library` = ?, `hosts` = ?, `pre_deploy` = ?, `post_deploy` = ?, `pre_release` = ?, `post_release` = ?, `last_deploy` = ?, `audit` = ?, `keep_version_num` = ?, `created_at` = ?, `updated_at` = ?, `p2p` = ?, `host_group` = ?, `gzip` = ?, `is_group` = ?, `pms_pro_name` = ? WHERE `id` = ?] - `3`, `g4Test-取消维护状态`, `2`, `1`, `20190118-155846`, `/root/gopubfakegit/fakegit`, ``, ``, `branch`, `git`, `/root/gopubfakegit/clonegit`, ``, `root`, `/root/gopubfakegit/deploy`, `/root/gopubfakegit/release`, `127.0.0.1`, `echo "代码检出前任务:"`, `echo "代码检出后任务::"`, `echo "同步完目标机后任务"`, `echo "更改版本软链接后任务::"
/opt/soft/node/bin/node -v
source ~/.bash_profile
cd /data/wanba_bug/app/gong4-server/tools
/opt/soft/node/bin/node ./sh.process.js type=maintainend
`, `echo "版本发布发布完成后执行本地任务:::"`, `0`, `1`, `<nil>`, `<nil>`, `0`, ``, `1`, `0`, ``, `14` - Error 1210: Incorrect arguments to mysqld_stmt_execute
[ORM]2019/01/18 15:58:48  -[Queries/default] - [  OK /     db.Exec /     5.2ms] - [INSERT INTO `task_err_log` (`task_id`, `err_info`, `create_time`) VALUES (?, ?, ?)] - `67`, `Error 1210: Incorrect arguments to mysqld_stmt_execute`, `2019-01-18 07:58:48.347229896 +0000 +0000`

运行一段时间以后就会出现这个问题。 重启一下就好了。

请问 这个是我版本太高导致的么?node 构建前端 老是不成功

2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]prebuild: [email protected]
6 info lifecycle [email protected]
build: [email protected]
7 verbose lifecycle [email protected]build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
build: PATH: /usr/local/lib/nodejs/node-v12.14.1-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/gopub/vue-gopub/node_modules/.bin:/usr/local/lib/nodejs/node-v12.14.1-linux-x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/go/bin:/opt/gopub/bin:/root/bin
9 verbose lifecycle [email protected]build: CWD: /opt/gopub/vue-gopub
10 silly lifecycle [email protected]
build: Args: [ '-c', 'node build/build.js' ]
11 silly lifecycle [email protected]build: Returned: code: 1 signal: null
12 info lifecycle [email protected]
build: Failed to exec build script
13 verbose stack Error: [email protected] build: node build/build.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/local/lib/nodejs/node-v12.14.1-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:223:5)
13 verbose stack at ChildProcess. (/usr/local/lib/nodejs/node-v12.14.1-linux-x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:223:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid [email protected]
15 verbose cwd /opt/gopub/vue-gopub
16 verbose Linux 3.10.0-1062.9.1.el7.x86_64
17 verbose argv "/usr/local/lib/nodejs/node-v12.14.1-linux-x64/bin/node" "/usr/local/lib/nodejs/node-v12.14.1-linux-x64/bin/npm" "run" "build"
18 verbose node v12.14.1
19 verbose npm v6.13.4
20 error code ELIFECYCLE
21 error

一次只能发布18台服务器

我们的项目现在是26台服务器,发布的时候超过18台的话 就会丢失一部分,也没有报错,第19个IP显示少最后一段,其它的直接不显示
QQ截图20190624193503

Gitlab CI支持

看到支持Jenkins,为什么不支持下Gitlab CI呢?

我本地环境安装配置错误

➜ gopub git:(master) ✗ ./control build
github.com/cihub/seelog/archive/archive.go:4:2: cannot find package "archive/tar" in any of:
/usr/local/go/src/archive/tar (from $GOROOT)
/Volumes/Macintosh HD/mygithub/gopub/src/archive/tar (from $GOPATH)
github.com/cihub/seelog/archive/archive.go:5:2: cannot find package "archive/zip" in any of:
/usr/local/go/src/archive/zip (from $GOROOT)
/Volumes/Macintosh HD/mygithub/gopub/src/archive/zip (from $GOPATH)

➜ brew info go
go: stable 1.10.2 (bottled), HEAD
Open source programming language to build simple/reliable/efficient software
https://golang.org
/usr/local/Cellar/go/1.10.2 (8,161 files, 336.8MB) *
Poured from bottle on 2018-05-06 at 19:58:01
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/go.rb
==> Requirements
Required: macOS >= 10.8 ✔
==> Options
--without-cgo
Build without cgo (also disables race detector)
--without-race
Build without race detector
--HEAD
Install HEAD version
==> Caveats
A valid GOPATH is required to use the go get command.
If $GOPATH is not specified, $HOME/go will be used by default:
https://golang.org/doc/code.html#GOPATH

You may wish to add the GOROOT-based install location to your PATH:
export PATH=$PATH:/usr/local/opt/go/libexec/bin

➜ ln -s /usr/local/go /usr/local/opt/go/

➜ ls /usr/local/go

使用docker安装完之后执行./control start报错

ps: unrecognized option: p
BusyBox v1.27.2 (2017-12-12 10:41:50 GMT) multi-call binary.

Usage: ps [-o COL1,COL2=HEADER]

Show list of processes

	-o COL1,COL2=HEADER	Select columns for display
gopub failed to start.

你在src/agent/server.json文件中带有ip,引起上面那个端口占用的问题

docker版,tar命令无 --preserve-permissions参数

cd /tmp/simu/go-test-20180410-101436 && tar --preserve-permissions -czf /tmp/simu/go-test-20180410-101436.tar.gz .

执行结果:
tar: unrecognized option: preserve-permissions
BusyBox v1.27.2 (2017-12-12 10:41:50 GMT) multi-call binary.

Usage: tar -[cxtZzJjahmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR] [FILE]...

Create, extract, or list files from a tar file

Operation:
c Create
x Extract
t List
f Name of TARFILE ('-' for stdin/out)
C Change to DIR before operation
v Verbose
Z (De)compress using compress
z (De)compress using gzip
J (De)compress using xz
j (De)compress using bzip2
a (De)compress using lzma
O Extract to stdout
h Follow symlinks
m Don't restore mtime
exclude File to exclude
X File with names to exclude
T File with names to include

错误:exit status 1

=============

提2条建议

1.可考虑增加jenkins编译,在发布上线时考虑项目是否编译
2.考虑多项目支持批量上线

docker启动数据库是空的 lc13579443/gopub:latest版本

1、拉取了版本:
lc13579443/gopub:latest

sudo docker run --name gopub -e MYSQL_HOST=127.0.0.1 -e MYSQL_PORT=3306 -e MYSQL_USER=root -e MYSQL_PASS=root -e MYSQL_DB=walle -p 8192:8192 --restart always -d lc13579443/gopub:latest

数据库数据没有初始放进去。

2、数据库中表不存在或者用户不存在的时候
点击登录按钮一直显示"正在登录中"

启动的时候一直报错,如下


ListenAndServe:  listen tcp 0.0.0.0:8192: bind: address already
1525399664652004292 [Error] Listen failed:listen tcp 10.205.142.27:1902: bind: cannot assign requested address
1525399664652020021 [Error] Couldn't listen for peers connection: listen tcp 10.205.142.27:1902: bind: cannot assig
2018/05/04 10:07:44 Starting http server 10.205.142.27:1901

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.