Skip to content

3.2构建webui

创建子项目liuchenyun-online-webui

Online前端工程-master分支

0_1_D2M_Online_webUI

General Settings

Artifact paths: web-ui => web-ui // 输出成web-ui => web-ui目录

Version Control Settings

https://gitee.com/liuchenyunol/online-webui.git

用户名/密码 变量 

Checkout Rules // 没有设置任何目录,所以下面的Build Steps的Working directory也不用设置

Build Steps

第一步:
npm install --force
2:
npm run test:unit
3:
npm run style-lint
4:
npm run eslint
5:
npm run build

Checkout Rules // 上一步VCS没有设置任何目录,所以下面的Build Steps的Working directory也不用设置

Triggers

Trigger a build on each check-in  勾选及以下

Use default value (60 seconds) // 选择默认60秒

Parameters

teamcity.runner.commandline.stdstreams.encoding  = UTF8

Agent Requirements

选择自己机器

0_2_DistributePkg_WebUI_NVDAnalyst

General Settings

Artifact paths:

dependency-check-*.html
dependency-check-*.xml
dependency-check-*.csv

Build Steps

/opt/dependency-check/bin/dependency-check.sh --project "supermapol-webui" \
  --scan "webui-depends" \
  --junitFailOnCVSS %NVD_FAILONCVSS% \
  --disableNuspec --disableNugetconf --disableAssembly \
  --disableGolangDep --disableGolangMod \
  --format ALL \
  --nvdValidForHours 24 \
  --nvdApiKey b21db591-b686-4833-8943-d521f110b6fd \
  --nvdDatafeed http://nvdmirror.ispeco.com/nvdcve-{0}.json.gz \
  --retireJsUrl http://maven.ispeco.com/repository/tizi/Retirejs/jsrepository.json

Triggers

Finish Build Trigger  ,选第一步

Failure Conditions

Additional Failure Conditions

Fail build on specific text in build log:

Process exited with code 1

出现漏洞评分高于%NVD_FAILONCVSS%分的依赖,检测失败

Build Features

XML report processing:

*-junit.xml

Dependencies

web-ui/libs=>webui-depends
web-ui/js=>webui-depends
NVD_FAILONCVSS=7

0_3_LiuchenyunOL_Online_WebUI_Images

Version Control Settings

distribution_liuchenyunol
https://gitee.com/liuchenyunol/distribution_liuchenyunol.git

Checkout Rules
+:docker-compose/Dockerfile_online_webui => .

Build Step

1:
docker build & push
chmod 777 build.sh && ./build.sh
2:
update image
192.168.31.157
sudo kubectl get pod |grep online-webui| awk '{print $1}' | xargs kubectl delete pod

Authentication method :Password // 注意第二步选Password进行ssh

Triggers

VCS Trigger   // 默认60秒

Finish Build Trigger
Wait for a successful build in: liuchenyun-online-front / liuchenyun-online-developer-center-webui / 0_1_D2M_Online_Developer_Center_WebUI
Branch filter:
+:<default>  // 选择第一步的路径


Retry Build Trigger
Re-add build delay: 0 seconds, number of attempts: 3
Trigger a new build with the same revisions

Build Features

Docker Support

Dependencies

Artifact Dependencies
选第一步打包路径,设置web-ui=> %system.teamcity.build.checkoutDir%/web-ui

Agent Requirements

设置agent

0_4_LiuchenyunOL_Online_WebUI_Images_Trunk

Version Control Settings

选的时候直接选第二步的,会复制下来

// 外面设置目录
Checkout Rules
+:docker-compose/Dockerfile_online_webui => .

Build Step

chmod 777 build_trunk.sh
./build_trunk.sh

Build Features

Docker Support

0_6_Sonar_Online_WebUI

VCS Root

sonar_online-webui
https://gitee.com/supermapol/online-webui

Build Step

1: npm install
npm i -f

2: run test
npm run test:unit

3: sonar
sonar-scanner -Dsonar.testExecutionReportPaths=reports-test/test-reporter.xml -Dsonar.host.url=%system.SONAR_ADDRESS%  -Dsonar.scm.exclusions.disabled=true -Dsonar.login=%system.sonar_login% -Dsonar.password=%system.sonar_password%

Triggers

Finish Build Trigger
Wait for a successful build in: supermap-online-front-end / supermap-online-webui / 0_3_SupermapOL_Online_WebUI_Images

Branch filter:
+:<default>  // 选择第一步的路径

Parameters

http://sonar.liuchenyun.com
liuchenyun 
liuchenyun

错误

现在的机器不能执行yum clean all。执行完后yum update就会报错:

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"

gcc版本太低




gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

sudo yum install devtoolset-7-gcc* //安装不了,没有可用软件包

sudo yum install epel-release // 安装扩展包后再次下载
sudo yum install devtoolset-7-gcc*

scl enable devtoolset-7 bash // 启动

gcc --version //升级了

CentOS 7官方仓库关闭导致无法找到包

__________________________________


mkdir ~/gcc-build && cd ~/gcc-build

# 下载源码包
wget http://ftp.gnu.org/gnu/gcc/gcc-8.5.0/gcc-8.5.0.tar.xz

# 解压源码
tar xf gcc-8.5.0.tar.xz
cd gcc-8.5.0

# 自动下载依赖(GMP、MPFR、MPC、ISL)
./contrib/download_prerequisites