版本基线自动化之Linux
上一篇笔者叙述了如何在windows平台上进行自动化打包,这次采用linux平台
1、start.bat : 调用cleanall.bat脚本 ,从svn服务器中检出代码,并采用7-Zip工具进行压缩并调用teasefile.bat脚本和output_linux.bat脚本;
1.1、cleanall.bat: 清除环境 并利用secureCRT执行vbs脚本> aloneclean.vbs
1.2、teasefile.bat: 将压缩包利用secureCRT工具中的sfxcl命令发送到linux编译服务器中 并利用CRT执行解压> gunzupScript.vbs
1.3、output_linux.bat: 编译项目 >antcompilerScript.vbs,这里我也是采用的是ant进行编译java,c使用gcc编译,利用smb实现linux文件共享,将安装程序复制到svn服务器中,最后打开程序所在的位置即可;
start.bat
rem clean D:\yb\workspace\*
rem Create by dq
rem Create date 2017/5/10 @echo off set _work=D:\yb\6.0\workspace
set _log=D:\tools\compilerproject\alone\cleanlog.txt
set _console=%_work%\console
set _ldapserver=%_work%\ldapserver
set _package=%_work%\package
set _package(windxldap)=%_work%\package(winxldap)
set _trunk_win=%_work%\trunk_win.rar
cd /d %_work%
del /s /q %_trunk_win%
rd /s /q %_work%\.svn
rd /s /q %_console%
rd /s /q %_ldapserver%
rd /s /q %_package%
rd /s /q %_package(windxldap)%
cleanall.bat
rem clean source code and installation package
rem Create by dq
rem Create date 2017/4/30 set _work=D:\yb\QHLDAP\6.0\src
set _setup=D:\目录服务管理系统\V6.0\QH-LDAP_6.01.001\安装包\Linux rem clean 192.168.0.234:D:\yb\workspace\* D:\yb\Log rd /q /s %_work%\Linux rem clean installation package rd /q /s %_setup%\* rem clean 192.168.0.92:/yb/work/* cd /d D:\yb\SecureCRT
SecureCRT.exe /LOG D:\yb\clean.txt /SCRIPT Scripts/aloneclean.vbs -2 root@192.168.0.92 /password qihang
aloneclean.vbs
#$language = "VBScript"
#$interface = "1.0" crt.Screen.Synchronous = True ' This automatically generated script may need to be
' edited in order to work correctly. Sub Main
crt.Screen.Send "cd /" & chr(13)
crt.Screen.WaitForString "[root@localhost /]# "
crt.Screen.Send "cd /y" & chr(9) & "w" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost work]# "
crt.Screen.Send "rm -rf s" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost work]# "
crt.Screen.Send "rm 0" & chr(8) & "=-" & chr(8) & chr(8) & "=" & chr(8) & "-rf o" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost work]# "
crt.Screen.Send "rm -rf o" & chr(8) & "p" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost work]# "
crt.Screen.Send "rm -rf c" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost work]# "
crt.Session.Disconnect
crt.Quit
End Sub
teasefile.bat
rem send source code
rem Create by dq
rem Create date 2017/5/10 rem send to Linux cd /d D:\yb\SecureCRT
sfxcl "D:\yb\QHLDAP\6.0\src\trunk_lin.gzip" sftp://root:qihang@192.168.0.92/../yb/work rem run 'gunzipScript' script SecureCRT.exe /SCRIPT Scripts/gunzipScript.vbs -2 root@192.168.0.92 /password qihang
gunzipScript.vbs
#$language = "VBScript"
#$interface = "1.0" crt.Screen.Synchronous = True ' This automatically generated script may need to be
' edited in order to work correctly. Sub Main
crt.Screen.Send "cd /" & chr(13)
crt.Screen.WaitForString "[root@localhost /]# "
crt.Screen.Send "cd /yb/w" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost work]# "
crt.Screen.Send "tar xvf t" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost work]# "
crt.Screen.Send "ls" & chr(13)
crt.Screen.WaitForString chr(27) & "[m[root@localhost work]# "
crt.Screen.Send "rm -rf t" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost work]# "
crt.Screen.Send "ls" & chr(13)
crt.Session.Disconnect
crt.Quit
End Sub
output_linux.bat
rem stop mstsc.exe; open release folder
rem Create by dq
rem Create date 2017/5/2 rem run 'compilerScript' scirpt cd /d D:\yb\SecureCRT
SecureCRT.exe /SCRIPT Scripts/antcompilerScript.vbs -2 root@192.168.0.92 /password qihang rem long-distance copy installation project net use * /del /y
net use \\192.168.0.92\public P@ssw0rd /user:root
copy \\192.168.0.92\public\* D:\目录服务管理系统\V6.0\QH-LDAP_6.01.001\安装包\Linux\setup rem open installation project dir D:\
start D:\目录服务管理系统\V6.0\QH-LDAP_6.01.001\安装包\Linux
@exit
antcompilerScript.vbs
#$language = "VBScript"
#$interface = "1.0" crt.Screen.Synchronous = True ' This automatically generated script may need to be
' edited in order to work correctly. Sub Main
crt.Screen.Send "cd /" & chr(13)
crt.Screen.WaitForString "[root@localhost /]# "
crt.Screen.Send "cd" & chr(8) & chr(8) & "chmod -R 777 /y" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost /]# "
crt.Screen.Send "cd /yb" & chr(9) & "comp" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost compilerproject]# "
crt.Screen.Send "ant -f init.xml" & chr(13)
crt.Screen.WaitForString "[root@localhost compilerproject]# "
crt.Screen.Send "ant -f Ld" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost compilerproject]# "
crt.Screen.Send "cd /" & chr(13)
crt.Screen.WaitForString "[root@localhost /]# "
crt.Screen.Send "chmod -R 777 /y" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost /]# "
crt.Screen.Send "cd /yb/work/package-x/QHLdap-Web/WEB/web/webapp/LDAPProject/WEB-INF/classes" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost classes]# "
crt.Screen.Send "rm -f *.jar" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost classes]# "
crt.Screen.Send "chmod -R 777 /y" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost classes]# "
crt.Screen.Send "cd /yb" & chr(9) & "w" & chr(9) & "s" & chr(9) & "qh" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost qhldap-1.0]# "
crt.Screen.Send "ls" & chr(13)
crt.Screen.WaitForString chr(27) & "[m[root@localhost qhldap-1.0]# "
crt.Screen.Send "./ldap-" & chr(9) & ".sh" & chr(13)
crt.Screen.WaitForString "[root@localhost qhldap-1.0]# "
crt.Screen.Send "cd /y" & chr(9) & "w" & chr(9) & "p" & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost package-x]# "
crt.Screen.Send "./package." & chr(9) & chr(13)
crt.Screen.WaitForString "[root@localhost package-x]# "
crt.Screen.Send chr(13)
crt.Screen.WaitForString "[root@localhost package-x]# "
crt.Screen.Send chr(13)
crt.Session.Disconnect
crt.Quit
End Sub
这里笔者说下如何使用Samba共享文件
安装Samba
1) 检查是否安装 rpm –qa | grep samba
2) 修改/etc/samba/smb.conf
workgroup = WORKGROUP
hosts allow=192.168.0.234
3) 在文件的结尾加上
[public]
comment=Public Stuff
path = /yb/wroktest
public = yes
writable =yes
4) 重启服务: service smb restart
5) 创建samba客户:smbpasswd –a root回车后提示输入密码这里的root必须在系统已经存在
6) Windows下链接,启动运行,输入Linux的ip :\\192.168.0.92 输入smb账号密码就可以了
版本基线自动化之Linux的更多相关文章
- 版本基线自动化之windows
1.背景: 目前项目维护周期过程中,制作调试版本和对外发布版本次数比较频繁,流程过于繁琐和随意,且打包制作人成为瓶颈,为了规范版本基线流程和实现全员自动化参与,拟定版本基线自动化方案. 2.目标: 版 ...
- 【Linux】CentOS下升级Python和Pip版本全自动化py脚本
[Linux]CentOS下升级Python和Pip版本全自动化py脚本 CentOS7.6自带py2.7和py3.6 想要安装其它版本的话就要自己重新下载和编译py其它版本并且配置环境,主要是软链接 ...
- PHP 基于 Jenkins ansible 动态选择版本进行自动化部署与回滚(第二版)
PHP 基于 Jenkins ansible 动态选择版本进行自动化部署与回滚(第二版) 先看流程图: 大概介绍一下: 版本选择使用jenkins 中的 git parameter 插件实现 回滚方式 ...
- 设置Win10默认启动的Linux子系统版本,启动指定Linux发行版
设置Win10默认启动的Linux子系统版本,启动指定Linux发行版 MS酋长一年前已经与大家分享了启用“适用于Linux的Windows子系统(WSL)”的方法,但当时所能安装的只有由Cano ...
- linux各版本基线检查脚本(centos6、centos7、ubuntu系列)
以下是centos7基线检查脚本: #!/bin/bash #version v1. by pensar #操作系统linux 配置规范--centos7 cat <<EOF ****** ...
- shell脚本实现自动化安装linux版本的loadrunner agent(centos6.8)
#!/bin/bash #Centos6下安装LoadRunner负载机 #@author Agoly #@date #@source 高级测试技术交流圈: yum -y install expect ...
- 前端自动化部署linux centOs + Jenkins + nignx + 单页面应用
Jenkins是什么? Jenkins 是一款业界流行的开源持续集成工具,广泛用于项目开发,具有自动化构建.测试和部署等功能. 准备工作 Linux centOS系统阿里云服务器一个 码云一个存放vu ...
- 基于HTTP和TFTP的PXE批量自动化安装Linux系统
CentOS 6.5 PXE自动化部署系统 拓扑图如下: 步骤: 1. 安装http服务,上传ISO文件 [root@UCS-1 ~]# yum install httpd –y [root@UCS ...
- 安全基线自动化扫描、生成报告、加固的实现(以Tomcat为例)
一.背景说明 当前在服务上线前,安全部门都会对服务基线配置进行把关,整个流程可以分为扫描.生成报告.修复三步. 在执行这一流程时当前普遍的做法是半自动化的,扫描和生成报告是自动化的,执行扫描.执行生成 ...
随机推荐
- python学习之路 目录
python Python基础-1 python由来 字符编码 注释 pyc文件 python变量 导入模块 获取用户输入 流程控制if while python基础-2 编码转换 pycharm 配 ...
- [Web 前端] 023 js 的流程控制、循环和元素的获取、操作
1. Javascript 流程控制 用于"基于不同条件执行不同的动作"的场合 1.1 if 语句 三种形式 // 第一种 if... // 第二种 if... else ... ...
- [转帖]Intel Xeon路线图:7nm处理器要上DDR5、PCIe 5.0
Intel Xeon路线图:7nm处理器要上DDR5.PCIe 5.0 https://www.cnbeta.com/articles/tech/849631.htm 在月初的投资者会议上,Intel ...
- Linux 查看CPU 核数 还有 CPU 个数的命令
cat /proc/cpuinfo | grep 'physical id' | sort | uniq | wc -l 个数 cat /proc/cpuinfo | grep 'process' | ...
- Tensorflow模型保存与加载
在使用Tensorflow时,我们经常要将以训练好的模型保存到本地或者使用别人已训练好的模型,因此,作此笔记记录下来. TensorFlow通过tf.train.Saver类实现神经网络模型的保存和提 ...
- python day1-requests
一.什么是requests Requests是用python语言基于urllib编写的,采用的是Apache2 Licensed开源协议的HTTP库. 相对于urllib库(自带,无需手动安装)而言, ...
- [LeetCode] 213. 打家劫舍 II
题目链接:https://leetcode-cn.com/problems/house-robber-ii/ 题目描述: 你是一个专业的小偷,计划偷窃沿街的房屋,每间房内都藏有一定的现金.这个地方所有 ...
- docker elk
1.核心组成 ELK由Elasticsearch.Logstash和Kibana三部分组件组成: Elasticsearch是个开源分布式搜索引擎,它的特点有:分布式,零配置,自动发现,索引自动分片, ...
- php strpos() 函数介绍与使用方法详解
本文主要和大家介绍PHP中mb_strpos的使用技巧,通过使用语法以及实例给大家详细分析了用法,需要的朋友参考学习下.希望能帮助到大家.mb_strpos(PHP 4 >= 4.0.6, PH ...
- wordpress各个文件作用详解
1.index.php:wordpress核心索引文件,即博客输出文件. 2.license.txt:WordPress GPL许可证文件. 3.my-hacks.php:定义了博客输出之前处理的追加 ...