revel nohup 部署
来源:互联网 发布:淘宝闲鱼怎么交易流程 编辑:程序博客网 时间:2024/05/21 10:36
#!/bin/bash#function that prints out usage syntaxsyntax () { echo " " echo "./app-xxx.sh [options]" echo " " echo " [options] is one of create | backup | rm | read " echo " start - start concurrent application " echo " " echo " stop - stop concurrent application" echo " " echo " restart - restart concurren application" echo " " echo " bstart - build and start concurrent application" echo " " echo " brestart - build and restart concurrent application" echo " " echo " "}project='whale'port=''$2runmode=''$3application='app-'${runmode}'-'${port}cd ./../../ # project pathrunpath=`pwd`'/'${project}'/deploy/'${application}if echo "$port" | grep -q '^[0-9]\+$'; then echo "["$1"] application: $application ,port: $port."else echo "$0 {run:start|stop|restart} {port:number} {runmode:dev|test|prod}" exit 4fiif [ $runmode != "dev" ] && [ $runmode != "test" ] && [ $runmode != "prod" ]; then echo "$0 {run:start|stop|restart} {port:number} {runmode:dev|test|prod}" exit 4fifunction build(){ if [ -d '${runpath}' ];then rm -rf ${runpath} fi mkdir ${runpath} touch ${runpath}/run.log sed -i '' "s/^http.port.*/http.port = ${port}/g" ./${project}/conf/app.conf if [ -f '${project}.tar.gz' ];then rm ${project}.tar.gz fi GOOS=linux GOARCH=amd64 revel package whale # GOOS=darwin GOARCH=amd64 revel package ${project} tar -zxf whale.tar.gz -C ${runpath} echo ${runpath}" ${1}模式 ${runmode}"}function start() { nohup "${runpath}/${project}" -importPath ${project} -srcPath "${runpath}/src" -runMode prod 2>&1 >> ${runpath}/run.log 2>&1 /dev/null & echo $! > ${runpath}/run_pid echo ${runpath}" ${1}模式 ${runmode}"}function kill() { kill -9 `cat ${runpath}/run_pid` # killall ${application} echo ${runpath}" ${1}"}case $1 in start) start " 服务已重启..." ;; restart) kill " 服务已停止..." start " 服务已重启..." ;; bstart) build " 服务已构建..." start " 服务已启动..." ;; stop) kill " 服务已停止..." ;; brestart) kill " 服务已停止..." build "服务已构建..." start " 服务已重启..." ;; *) echo "$0 {start|stop|restart}" exit 4 ;;esac
附带github链接 https://github.com/11101171/whale
0 0
- revel nohup 部署
- iOS revel
- 【Go web开发之revel+mgo】第11章 部署到heroku上
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup
- nohup &
- nohup
- nohup
- nohup
- nohup
- nohup
- python一些细节小结(1)
- JSON
- Glide 入门到精通之一——添加Glide
- border-radius:50%和100%究竟有什么区别
- CSS direction属性简介与实际应用
- revel nohup 部署
- 关于CSS中 用“rem" 在谷歌浏览器下的问题
- 一道JS 面试题
- Java --- Thread VS Process
- MyBatis自定义分页插件
- iOS开发~CocoaPods使用详细说明
- 菜鸟Java使用Netty
- JavaScript小练习
- 高性能JavaScript之重绘与重排