上一篇笔者叙述了如何在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的更多相关文章

  1. 版本基线自动化之windows

    1.背景: 目前项目维护周期过程中,制作调试版本和对外发布版本次数比较频繁,流程过于繁琐和随意,且打包制作人成为瓶颈,为了规范版本基线流程和实现全员自动化参与,拟定版本基线自动化方案. 2.目标: 版 ...

  2. 【Linux】CentOS下升级Python和Pip版本全自动化py脚本

    [Linux]CentOS下升级Python和Pip版本全自动化py脚本 CentOS7.6自带py2.7和py3.6 想要安装其它版本的话就要自己重新下载和编译py其它版本并且配置环境,主要是软链接 ...

  3. PHP 基于 Jenkins ansible 动态选择版本进行自动化部署与回滚(第二版)

    PHP 基于 Jenkins ansible 动态选择版本进行自动化部署与回滚(第二版) 先看流程图: 大概介绍一下: 版本选择使用jenkins 中的 git parameter 插件实现 回滚方式 ...

  4. 设置Win10默认启动的Linux子系统版本,启动指定Linux发行版

    设置Win10默认启动的Linux子系统版本,启动指定Linux发行版   MS酋长一年前已经与大家分享了启用“适用于Linux的Windows子系统(WSL)”的方法,但当时所能安装的只有由Cano ...

  5. linux各版本基线检查脚本(centos6、centos7、ubuntu系列)

    以下是centos7基线检查脚本: #!/bin/bash #version v1. by pensar #操作系统linux 配置规范--centos7 cat <<EOF ****** ...

  6. shell脚本实现自动化安装linux版本的loadrunner agent(centos6.8)

    #!/bin/bash #Centos6下安装LoadRunner负载机 #@author Agoly #@date #@source 高级测试技术交流圈: yum -y install expect ...

  7. 前端自动化部署linux centOs + Jenkins + nignx + 单页面应用

    Jenkins是什么? Jenkins 是一款业界流行的开源持续集成工具,广泛用于项目开发,具有自动化构建.测试和部署等功能. 准备工作 Linux centOS系统阿里云服务器一个 码云一个存放vu ...

  8. 基于HTTP和TFTP的PXE批量自动化安装Linux系统

    CentOS 6.5 PXE自动化部署系统 拓扑图如下: 步骤: 1.  安装http服务,上传ISO文件 [root@UCS-1 ~]# yum install httpd –y [root@UCS ...

  9. 安全基线自动化扫描、生成报告、加固的实现(以Tomcat为例)

    一.背景说明 当前在服务上线前,安全部门都会对服务基线配置进行把关,整个流程可以分为扫描.生成报告.修复三步. 在执行这一流程时当前普遍的做法是半自动化的,扫描和生成报告是自动化的,执行扫描.执行生成 ...

随机推荐

  1. Java合并数组的实现方式

    String[] aa = {"11","22","33"};String[] bb = {"44","55& ...

  2. C#多播委托详解

    包含多个方法的委托成为多播委托,调用多播委托,可以按照顺序连续调用多个方法,因此,委托的签名就必须返回void;否则,就只能得到委托调用的最好一个方法的结果 1.多播委托可以用运算符"+&q ...

  3. spring security OAuth2.0之客户端Client的实现

    项目代码:https://github.com/hankuikuide/microservice-spring-security-oauth2 网上多数的项目客户端都是采用纯js写,或用postman ...

  4. uni-app中页面部分内容使用索引列表(uni-indexed-list),动态数据

    一.引入uni-indexed-list.uni-icons组件 从uni-app插件市场下载或从HBuilder X提供的hello uni-app模板中复制 二.页面中引用 三.对请求获得的数据处 ...

  5. 关于cron4j的使用

    cron4j的主要实体是调度程序.使用it.sauronsoftware.cron4j.scheduler实例,您可以在一年中的固定时间执行任务.调度程序可以每分钟执行一次任务,每五分钟执行一次,星期 ...

  6. Windows及Android倍速播放视频软件下载

    目录 1. 更多推荐 2. 关键字 3. 按 4. 软件下载 4.1. IOS应用商店 4.2. 网盘下载 5. 软件介绍 5.1. PotPlayer(Windows) 5.2. MoboPlaye ...

  7. Django视图中使用本地缓存

    Django服务器视图使用缓存可以大大减小服务器的压力,对数据实时性要求不高的场景使用缓存非常适合. 使用Django本地缓存 1. 在settings.py配置CACHES CACHES = { ' ...

  8. linux c++下遍历文件

    https://blog.csdn.net/u013617144/article/details/44807333

  9. oracle汇编01

    1: / define numeric label "1"one: / define symbolic label "one"/ ... assembler c ...

  10. 如何设置Linux虚拟机的IP地址

    本文会详细的解释如何在Linux虚拟机下设置IP地址 我的虚拟机是CentOS 首先,打开你的虚拟机 1.修改主机名 修改完主机名之后,别忘了用:wq命令保存退出 然后我们来设置虚拟机的IP地址 首先 ...