5

ZStack源码编译

 3 years ago
source link: https://studygolang.com/articles/32276
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ZStack源码编译

B3ale · 大约15小时之前 · 29 次点击 · 预计阅读时间 4 分钟 · 不到1分钟之前 开始浏览    

! https://zhuanlan.zhihu.com/p/338679138

ZStack 源码编译

更新 yum 源以及安装相关依赖:

$ curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
$ yum clean all
$ yum makecache
$ yum install -y vim tmux wget curl maven ant mariadb-server git zip unzip patch python-setuptools

下载 ZStack 以及相关安装包:

$ git clone https://github.com/zstackio/zstack.git -b 3.10.2
$ git clone https://github.com/zstackio/zstack-utility.git -b 3.10.2
$ git clone https://github.com/zstackio/zstack-dashboard.git -b 3.10.2
$ git clone https://github.com/zstackio/zstack-vyos.git -b 3.8.3

下载相应的 Tomcat 压缩包:

$ wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.55/bin/apache-tomcat-8.5.55.zip

安装 Golang 并设置环境变量:

$ wget https://mirrors.nju.edu.cn/golang/go1.10.8.linux-amd64.tar.gz
$ tar -C /usr/local -xvzf go1.10.8.linux-amd64.tar.gz
$ vim ~/.bashrc
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin

安装数据库:

$ cd zstack && ./conf/db/deploydb.sh

进入 zstack-utility,并打上以下 patch:

diff --git a/zstackbuild/build.properties b/zstackbuild/build.properties
index 35d8259..3610877 100644
--- a/zstackbuild/build.properties
+++ b/zstackbuild/build.properties
@@ -18,11 +18,11 @@ zstack.build_version=${build_version}
 zstackutility.source=${zstack_build_root}/zstack-utility
 zstackutility.build_version=${build_version}

-apachetomcat.pkg=${zstack_build_root}/apache-tomcat-8.5.57.zip
+apachetomcat.pkg=${zstack_build_root}/apache-tomcat-8.5.55.zip

 # For UI 1.x
 zstackdashboard.source=${zstack_build_root}/zstack-dashboard
-mevocoui.source=${zstack_build_root}/mevoco-ui
+#mevocoui.source=${zstack_build_root}/mevoco-ui
 zstackdashboard.build_version=${build_version}
 #zstackdashboard.source=${zstack_build_root}/zstack-ui
 #zstackdashboard.build_version=master
@@ -129,6 +129,6 @@ zstack.ui.source=${zstack_build_root}/zstack-ui
 build.zstack.ui.war.script=${zstackbuild.scripts}/build_zstack_ui_war.sh
 mevocoui2.build_version=${build_version}
 mevocouiserver.build_version=${build_version}
-build.zstack.ui.war=true
+build.zstack.ui.war=false
 vendor.name=
 vendor.custom.path=
diff --git a/zstackbuild/build.xml b/zstackbuild/build.xml
index a4b9629..05b0d39 100644
--- a/zstackbuild/build.xml
+++ b/zstackbuild/build.xml
@@ -291,15 +291,6 @@
             <sequential>
                 <antcall target="build-zstack-vyos"/>
             </sequential>
-            <sequential>
-                <antcall target="build-zstack-network"/>
-            </sequential>
-            <sequential>
-                <antcall target="build-zstack-sharedblock"/>
-            </sequential>
-            <sequential>
-                <antcall target="check-zstack-distro"/>
-            </sequential>
         </parallel>
     </target>

@@ -383,12 +374,6 @@
                 <antcall target="assemble-zstack-vyos"/>
             </sequential>
             <sequential>
-                <antcall target="assemble-zstack-network"/>
-            </sequential>
-            <sequential>
-                <antcall target="assemble-zstack-sharedblock"/>
-            </sequential>
-            <sequential>
                 <antcall target="assemble-zstack-promtail"/>
             </sequential>
             <sequential>

更换 maven 镜像:

  <mirrors>
    <mirror>
      <id>aliyun</id>
      <mirrorOf>*</mirrorOf>
      <name>Aliyun Mirror</name>
      <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
  </mirrors>

编译安装 zstack:

$ cd zstack && mvn -DskipTests clean install

编译安装 zstack-utility:

$ cd zstack-utility/zstackbuild
$ ant -Dzstack_build_root=$ZSTACK_HOME all-in-one

2020.12.22 by B3ale


有疑问加站长微信联系(非本文作者)

280

本文来自:简书

感谢作者:B3ale

查看原文:ZStack源码编译

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:1006366459


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK