日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Easypack: JEECG的容器化编译环境快速构建

發布時間:2024/3/13 编程问答 16 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Easypack: JEECG的容器化编译环境快速构建 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

這篇文章整理一下使用鏡像方式進行JEECG編譯環境的標準化,并將標準化的編譯鏡像和腳本放到了easypack上。

JEECG介紹

詳細的介紹可以參看如下鏈接:

  • http://www.jeecg.com/

框架構成&編譯環境

  • 框架主要構成

前端:Angular + NG-Zorro + NG-ALAIN

后端:Spring Boot + Hibernate + MySQL + Redis

注:前端除了Angular還有Vue版,后端除了Spring boot還有Spring MVC版本等

  • 編譯環境

前端:npm + angular-cli

/data/jeecg-boot/ant-design-jeecg-angular # node -v v10.15.3 /data/jeecg-boot/ant-design-jeecg-angular # npm -v 6.4.1 /data/jeecg-boot/ant-design-jeecg-angular # /data/jeecg-boot/ant-design-jeecg-angular # ng --version_ _ ____ _ ___/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___||___/Angular CLI: 7.3.8 Node: 10.15.3 OS: linux x64 Angular: 7.2.13 ... animations, common, compiler, core, forms, platform-browser ... platform-browser-dynamic, routerPackage Version ----------------------------------------------------------- @angular-devkit/architect 0.13.8 @angular-devkit/build-angular 0.13.8 @angular-devkit/build-optimizer 0.13.8 @angular-devkit/build-webpack 0.13.8 @angular-devkit/core 7.3.8 @angular-devkit/schematics 7.3.8 @angular/cdk 7.3.7 @angular/cli 7.3.8 @angular/compiler-cli 7.2.14 @angular/language-service 7.2.14 @ngtools/webpack 7.3.8 @schematics/angular 7.3.8 @schematics/update 0.13.8 rxjs 6.3.3 typescript 3.2.4 webpack 4.29.0/data/jeecg-boot/ant-design-jeecg-angular #

后端:jdk + maven

/data/jeecg-boot # mvn --version Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T19:00:29Z) Maven home: /usr/share/maven Java version: 1.8.0_201, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8-openjdk/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.9.87-linuxkit-aufs", arch: "amd64", family: "unix" /data/jeecg-boot #

使用Easypack快速構建

前提事項

需要如下前提事項:

  • 軟件需求:git + docker
  • 網絡需求:能夠聯網(maven和yarn或者npm安裝時的需要)

Step 1: git clone easypack

liumiaocn:easypack liumiao$ git clone http://github.com/liumiaocn/easypack.git Cloning into 'easypack'... warning: redirecting to https://github.com/liumiaocn/easypack.git/ remote: Enumerating objects: 172, done. remote: Counting objects: 100% (172/172), done. remote: Compressing objects: 100% (111/111), done. Receiving objects: 29% (560/1886), 252.01 KiB | 11.00 KiB/s Receiving objects: 29% (560/1886), 420.01 KiB | 3.00 KiB/s remote: Total 1886 (delta 69), reused 127 (delta 32), pack-reused 1714 Receiving objects: 100% (1886/1886), 917.55 KiB | 5.00 KiB/s, done. Resolving deltas: 100% (875/875), done. liumiaocn:easypack liumiao$

確認使用方法

liumiaocn:easypack liumiao$ cd easypack/jeecg/ liumiaocn:jeecg liumiao$ sh jeecg-mgnt.sh Usage: jeecg-mgnt.sh ACTION TYPEACTION: download|build|deploy|allTYPE: boot|angular|all|bootit(build)|angularit(build)liumiaocn:jeecg liumiao$

執行sh jeecg-mgnt.sh build boot|angular會分別下載前端和后端和后端所需的鏡像并進行編譯。但建議使用sh jeecg-mgnt.sh build bootit|angularit進行docker中進行操作,因為編譯也就一條命令而已,而且過程和進度以及問題更容易確認

Step2: 下載jeecg-boot代碼

下載springboot+angular版jeecg源碼

liumiaocn:jeecg liumiao$ sh jeecg-mgnt.sh download all /usr/local/bin/git ## git clone https://gitee.com/dangzhenghui/jeecg-boot Cloning into 'jeecg-boot'... remote: Enumerating objects: 3351, done. remote: Counting objects: 100% (3351/3351), done. remote: Compressing objects: 100% (2572/2572), done. remote: Total 3351 (delta 1567), reused 1506 (delta 461)iB/s Receiving objects: 100% (3351/3351), 5.00 MiB | 441.00 KiB/s, done. Resolving deltas: 100% (1567/1567), done. liumiaocn:jeecg liumiao$

Step 3: 啟動后端構建容器進行構建

  • 啟動構建容器
liumiaocn:jeecg liumiao$ sh jeecg-mgnt.sh build bootit ## please use jeecg-mgnt.sh download all first ## enter jeecg-boot docker env : /data/jeecg-boot # ls README.md ant-design-jeecg-angular docs shell system activiti demo pom.xml start /data/jeecg-boot #
  • 使用mvn package進行構建
/data/jeecg-boot # mvn package [INFO] Scanning for projects... Downloading from aliyun: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-parent/2.0.3.RELEASE/spring-boot-starter-parent-2.0.3.RELEASE.pom ...省略[INFO] Building jar: /data/jeecg-boot/shell/target/shell-1.0.1.jar [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for jeecg-boot 1.0.1: [INFO] [INFO] jeecg-boot ......................................... SUCCESS [ 0.008 s] [INFO] system ............................................. SUCCESS [02:00 min] [INFO] demo ............................................... SUCCESS [ 13.568 s] [INFO] activiti ........................................... SUCCESS [02:27 min] [INFO] start .............................................. SUCCESS [ 21.388 s] [INFO] shell .............................................. SUCCESS [ 8.611 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 05:28 min [INFO] Finished at: 2019-05-04T09:48:25Z [INFO] ------------------------------------------------------------------------ /data/jeecg-boot #
  • 確認構建結果
/data/jeecg-boot # ls start/target/start-1.0.1.jar start/target/start-1.0.1.jar /data/jeecg-boot #
  • 在宿主機進行確認
liumiaocn:jeecg liumiao$ ls jeecg-boot jeecg-mgnt.sh liumiaocn:jeecg liumiao$ ls jeecg-boot/start/target/start-1.0.1.jar jeecg-boot/start/target/start-1.0.1.jar liumiaocn:jeecg liumiao$

注意:為了避免生成大量的無用構建用的容器,使用了--rm參數,所以退出的時候容器會自動被刪除

Step 4: 啟動后端構建容器進行構建

  • 啟動構建容器
liumiaocn:jeecg liumiao$ sh jeecg-mgnt.sh build angularit ## please use jeecg-mgnt.sh download all first ## enter jeecg angular docker env: /data/jeecg-boot/ant-design-jeecg-angular #
  • 使用yarn install安裝依賴
/data/jeecg-boot/ant-design-jeecg-angular # yarn install yarn install v1.13.0 ...省略 Done in 346.80s. /data/jeecg-boot/ant-design-jeecg-angular #
  • 使用yarn run build進行構建
/data/jeecg-boot/ant-design-jeecg-angular # yarn run build yarn run v1.13.0 $ npm run color-less && ng build --prod --build-optimizer ...省略 Date: 2019-05-04T12:24:07.251Z Hash: 03ad1b41615455245f1c Time: 195174ms chunk {0} common.b72f5c94f0a2b5358817.js (common) 11.1 kB [rendered] chunk {1} 1.14a400ce6b622cf59342.js () 93.7 kB [rendered] chunk {2} runtime.a66eb787a74866d3eaa8.js (runtime) 2.38 kB [entry] [rendered] chunk {3} main.7988b4eebdf4aadd8250.js (main) 1.75 MB [initial] [rendered] chunk {4} polyfills.ff3b6780233bc1953f44.js (polyfills) 41 kB [initial] [rendered] chunk {5} styles.729de6ab62f7983e42d3.css (styles) 525 kB [initial] [rendered] chunk {6} 6.229e87e49a8af736f26c.js () 205 kB [rendered] chunk {7} 7.014aec73e640183b0a3a.js () 29.5 kB [rendered] chunk {8} 8.619a69754856293e3225.js () 21.4 kB [rendered] chunk {9} 9.5c77308b3eca1ba6e1d6.js () 41 kB [rendered] chunk {10} 10.cd56ac7d8e73076516e0.js () 12.1 kB [rendered] chunk {11} 11.6533a0d45f33c99eb841.js () 176 kB [rendered] chunk {12} 12.59b18565ce0dd69ee9e5.js () 21.3 kB [rendered] chunk {13} 13.96665f3cf9e382722a20.js () 430 kB [rendered] chunk {scripts} scripts.bccec99eed536266748d.js (scripts) 1.12 MB [entry] [rendered]WARNING in budgets, maximum exceeded for initial. Budget 2 MB was exceeded by 1.42 MB. Done in 218.15s. /data/jeecg-boot/ant-design-jeecg-angular #
  • 確認構建結果
/data/jeecg-boot/ant-design-jeecg-angular # ls D: webapp /data/jeecg-boot/ant-design-jeecg-angular #
  • 在宿主機進行確認
/data/jeecg-boot/ant-design-jeecg-angular # exit liumiaocn:jeecg liumiao$ cd jeecg-boot/ant-design-jeecg-angular liumiaocn:ant-design-jeecg-angular liumiao$ ls D: webapp liumiaocn:ant-design-jeecg-angular liumiao$ ls D:/webapp 1.14a400ce6b622cf59342.js 3rdpartylicenses.txt assets polyfills.ff3b6780233bc1953f44.js 10.cd56ac7d8e73076516e0.js 6.229e87e49a8af736f26c.js common.b72f5c94f0a2b5358817.js runtime.a66eb787a74866d3eaa8.js 11.6533a0d45f33c99eb841.js 7.014aec73e640183b0a3a.js favicon.ico scripts.bccec99eed536266748d.js 12.59b18565ce0dd69ee9e5.js 8.619a69754856293e3225.js index.html styles.729de6ab62f7983e42d3.css 13.96665f3cf9e382722a20.js 9.5c77308b3eca1ba6e1d6.js main.7988b4eebdf4aadd8250.js liumiaocn:ant-design-jeecg-angular liumiao$

注意:為了避免生成大量的無用構建用的容器,使用了--rm參數,所以退出的時候容器會自動被刪除

總結

以上是生活随笔為你收集整理的Easypack: JEECG的容器化编译环境快速构建的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。