同步操作将从 WeBank/wecube-platform 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Install Java SE Development Kit (JDK)
Please refer to JDK install guide on how to install JDK.
Install Eclipse
PLease refer to Eclipse install guide on how to install Eclipse.
Install Mysql
Please refer to Mysql install guide on how to install Mysql.
Install node.js
Download node.js v10.16.3 from http://nodejs.cn/download
. Double-click the downloaded installation file to install it by default configuration.
Install object storage (optional)
To run WeCube on a local development computer, if you want to use material management and plugin functions, you need an object storage that supports S3 protocol, you can use remote services, or develop it locally.
Download docker image from dockerhub:https://hub.docker.com/r/minio/minio/
Install command as follows:
docker pull minio/minio
docker run -p 9000:9000 -e MINIO_ACCESS_KEY=access_key -e MINIO_SECRET_KEY=secret_key minio/minio server /data
Install We-CMDB
Running WeCube on a local development computer requires We-CMDB support.
You can use WeCMDB deployed on a remote server or run WeCMDB on a local development computer. PLease refer to We-CMDB guide, chapter “Quick Start” and “Developer Guide”.
Note: The local IP address needs to be added to the WeCMDB whitelist, WeCube can call the WeCMDB API interface..
You can download the code directly from git, or you can clone the code project to the local and then import it into Eclipse. This article takes local import as an example.
Import project
Choose to import an existing project
Choose an existing maven project
Select the code directory of wecube as the root directory, confirm and complete the import.
After the project is imported, the dependencies and compilations are automatically downloaded. Make sure the network connection is normal.
Switch view
After the project is imported, open the menu Window > Show View, choose Project Explorer
Initialize the database
Users and databases need to be built on a local or remote database.
Sample sql as follows:
create database wecube_dev DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;;
create USER 'wecube'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Abcd1234';
grant all privileges on `wecube_dev`.* to 'wecube'@'%' identified by 'Abcd1234';
Execute the following data initialization script on the database:
Configuration customization
In Project Explorer view, copy application-uat.yml
and rename as application-dev.yml
Edit application-dev.yml
, Modify the relevant configuration, without CAS in development mode, you can remove the CAS related configuration.
application-dev.yml
sample as follows:
server:
port: 8080
address: localhost
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/wecube_dev?characterEncoding=utf8&serverTimezone=UTC
username: wecube
password: password
wecube:
core:
cmdb-server-url: http://192.168.20.5:37000/cmdb
plugin:
plugin-hosts: 192.168.0.1, 192.168.0.2
plugin-package-name-of-deploy: deployment-plugin-name
s3:
endpoint: http://dev-s3-server:9000
access-key: access_key
secret-key: secret_key
In the local development mode, you can not enable the S3 service, and the endpoint does not need to be filled.
cmdb-server-url
is required, and the local IP needs to be added to the We-CMDB whitelist.
Start WeCube backend server
Open Window -> Preferences
, choose Java -> Installed JREs
, add new jdk config as follows:
Download dependencies, compile, as follows:
Start service:
Enter the following url in the browser http://localhost:8080/swagger-ui.html, it will redirect to the login page
Confirm after entering the user, will be redirected to the home page
Enter the following url again in the browser http://localhost:8080/swagger-ui.html , Go to the swagger page
Start WeCube frontend client
Run CMD (Win+R or the bottom right corner of the start menu entry), in the expanded command line window, enter the wecube-platform code subdirectory wecube-portal.
Install npm
npm install
After the installation is complete, execute the command
npm start
as follows:
Service started, open http://localhost:3000, go to the WeCube home page
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。