安装
wget -O - http s://raw.githu busercontent .com/mh-cbon/latest/master/bintray.sh | GH=mh-cbon/go-bin-rpm sh -xe
rpm .json配置文件
-
{
-
"name": "you-service-name", # rpm 包名称
-
"version": "0.0.1",
-
"release": "20221110",
-
"arch": "x86_64",
-
"summary": "",
-
"description": "",
-
"license": "iswbm.com",
-
"url": "http s://gtihu b.com/iswbm/!name!", # ! 相当于变量,会取前面 rpm 包名称
-
"files": [
-
{
-
"from": "./bin/!name!",
-
"to": "/usr/local/!name!/",
-
"base": "",
-
"type": ""
-
},
-
{
-
"from": "./!name!.service",
-
"to": "/usr/lib/systemd/system/",
-
"base": "",
-
"type": ""
-
}
-
]
-
}
SERVICE模板
-
[Unit]
-
Description=
-
After=syslog.target network.target
-
-
[Service]
-
Environment=key=value
-
Type=simple
-
NotifyAccess=all
-
TimeoutStartSec=0
-
Restart=always
-
User=root
-
ExecStart=/usr/local/xxxx/bin/xxxx
-
-
[Install]
-
WantedBy=multi-user.target
打包
go-bin-rpm generate -o rpms/xxxx-$(VERSION)-$(RELEASE).rpm
转:
mp.weix in.q q.com/s/TjqeSK9PNCkJAdeik2U_wA
阅读(376) | 评论(0) | 转发(0) |