windows下编译Grafana前端

本次介绍一下Windows环境源码编译步骤。
准备
  • 安装Go 1.8.1
  • 安装NodeJS LTS
  • 安装Git
安装golang开发环境:
 
安装gcc:
go编译grafana时需要用到gcc
在windows下安装gcc,参考链接:https://blog.csdn.net/zxy160/article/details/71734996
 
 
配置grafana
1、将grafana下载好的git 源码拷贝到go工作空间中目录下:

 

2、编译前端:
打开cmd窗口,进入项目目录下运行下面命令:
npm install -g yarn yarn install --pure-lockfile npm install -g grunt-cli grunt
关于node-sass的报错时,删除node_modules,然后安装 node-gyp(执行命令npm install -g node-gyp安装即可),最后再次执行yarn install --pure-lockfile以及其后命令。
 
编译项目文件。编译压缩后的文件会输出到/build和view文件夹下,建议实际使用直接复制整个/public文件夹替换线上生产版本。(Windows版本为/public, Linux版本为/usr/share/grafana/public)
 
重启grafana服务:
systemctl enable grafana-server
systemctl start grafana-server / systemctl restart grafana-server
 
参考原文链接:
  编译部署:https://www.jianshu.com/p/6290cfa285fd
  编译部署:https://www.jianshu.com/p/2d4f86561de6
  汉化部署:https://blog.csdn.net/w958660278/article/details/81161294
特此感谢以上原文作者分享。。。。。。

posted @ 2019-03-19 11:16  欣欣0115  阅读(701)  评论(0编辑  收藏  举报