版本基线自动化之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为例)
一.背景说明 当前在服务上线前,安全部门都会对服务基线配置进行把关,整个流程可以分为扫描.生成报告.修复三步. 在执行这一流程时当前普遍的做法是半自动化的,扫描和生成报告是自动化的,执行扫描.执行生成 ...
随机推荐
- C语言数组名取地址。。。
int main(){ int a[5] = { 1, 2, 3, 4, 5 }; printf("%08X ,%08X ,%08X ,%08X", a, &a, a + ...
- Ubuntu 解决wifi无法打开的问题 安装NVIDIA显卡驱动的正确姿势
游戏本型号Y7000 win10 Ubuntu16.04双系统 解决wifi无法打开的问题 解决方法: 1.打开终端输入:rfkill list all 出现如下提示:: 可以看到,优先级 ...
- Centos7防火墙开启3306端口
CentOS7的默认防火墙为firewall,且默认是不打开的. systemctl start firewalld # 启动friewall systemctl status firewalld # ...
- html5动画之等待加载动画
<div class="loading"> <p>100<span></span></p> </div> ; ...
- spring多个context:property-placeholder不生效问题
先来看下A和B两个模块,A模块和B模块都分别拥有自己的Spring XML配置,并分别拥有自己的配置文件: A模块的Spring配置文件如下: <?xml version="1.0&q ...
- AFNetworking2.0源码解析<一>
本篇先看看AFURLConnectionOperation,AFURLConnectionOperation继承自NSOperation,是一个封装好的任务单元,在这里构建了NSURLConnecti ...
- 关于jsp 获得当前绝对路径的方法
方法1) request.getRequestURL(); 方法2) request.getScheme()+"://"+request.getServerName()+&quo ...
- POJ 1966 Cable TV Network (最大流最小割)
$ POJ~1966~Cable~TV~Network $ $ solution: $ 第一眼可能让人很难下手,但本就是冲着网络流来的,所以我们直接一点.这道题我们要让这个联通图断开,那么势必会有两个 ...
- 2018微信小程序开发遇到的坑
第一个坑:wx.showModal(OBJECT) wx.showModal在安卓手机里,如果点击遮罩的话会关闭弹窗,不会有任何回调.而苹果的情况下则是点击遮罩不会有任何反应. 这样会有什么问题呢? ...
- Hive 笔试题
Hive 笔试题 考试时间: 姓名:____________ 考试成绩:____________ 考试时长:180 分钟 注意事项: 1. 自主答题,不能参考任何除本试卷外的其它资料. 2. 总成绩共 ...