jenkins配置(254) 发表于 2020-11-02 | 分类于 配置 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152name=ingestdbsvrversion=1.8.5time=$(date +%Y%m%d%H)images=${name}:${version}.${time}.${BUILD_NUMBER}tarname=${images}.tarpushurl=172.16.128.170:5000/${images}date +%H:%M:%Sdotnet build -c Release IngestDB.slncd IngestDB dotnet publish -c Release -o ../publishcd ..cp BinU/netcoreapp2.1/IngestDB.dll -r publish/cp BinU/netcoreapp2.1/IngestDBCore.dll -r publish/cp BinU/netcoreapp2.1/Plugin/IngestMatrixPlugin.dll -r publish/Plugin/cp BinU/netcoreapp2.1/Plugin/IngestDeviceInterfacePlugin.dll -r publish/Plugin/cp BinU/netcoreapp2.1/Plugin/IngestGlobalInterfacePlugin.dll -r publish/Plugin/cp BinU/netcoreapp2.1/Plugin/IngestTaskInterfacePlugin.dll -r publish/Plugin/cp BinU/netcoreapp2.1/Plugin/IngestTaskPlugin.dll -r publish/Plugin/cp BinU/netcoreapp2.1/Plugin/IngestDevicePlugin.dll -r publish/Plugin/cp BinU/netcoreapp2.1/Plugin/MSVNotifyPlugin.dll -r publish/Plugin/cp BinU/netcoreapp2.1/Plugin/IngestGlobalPlugin.dll -r publish/Plugin/cp BinU/netcoreapp2.1/Plugin/KafKaNotifyPlugin.dll -r publish/Plugin/cp BinU/netcoreapp2.1/Plugin/UdpNotifyPlugin.dll -r publish/Plugin/#docker images | grep 'ingestdbsvr' | awk '{print $3}' | xargs docker rmichmod -Rf 777 publishdocker build -t $images .docker tag $images $pushurldocker push $pushurltime=$(date +%Y%m%d%H)appname=ingestdbsvrversion=1.8.5.${time}.${BUILD_NUMBER}images=${appname}:${version}Oldtag=`docker images|grep ${appname}|awk '{print $2}'|sort -r|awk 'NR==1{print}'`container=`docker ps -a|grep ${appname}|awk '{print $1}'|sort -r|awk 'NR==1{print}'`echo ${appname}-${Oldtag}echo ${appname}-${version}echo ${appname}:${container}docker stop ${container}docker rm -f ${container}mkdir /sobeyhive/app/${appname}-${version}cp -rp /sobeyhive/app/${appname}-notchange/run.sh /sobeyhive/app/${appname}-${version}/rm -fr /sobeyhive/app/${appname}-${Oldtag} cd /RunScript/ sh ingestdbsvrsrg.sh ${version}sleep 5scp -r /other/sobeyhive/app/ingestmsgsvr-1.6.0/ingestmsgsvr/* root@172.16.128.117:/other/jenkins/workspace/IngestMsgSvr-Integration-SRG1.8.5/publish/ sleep 1