Linux version Baseline automation

Source: Internet
Author: User
Tags svn

In the previous article, I described how to automate packaging on the Windows platform, this time using the Linux platform

1, Start.bat: Call the Cleanall.bat script, check out the code from the SVN server, and use the 7-zip tool to compress and invoke Teasefile.bat script and Output_linux.bat script;

1.1. Cleanall.bat: Clear the environment and use SECURECRT to execute VBS scripts > Aloneclean.vbs

1.2. Teasefile.bat: Send the compressed package to the Linux compilation server using the SFXCL command in the SecureCRT tool and perform the decompression > Gunzupscript.vbs with the CRT

1.3, Output_linux.bat: Compile Project >antcompilerscript.vbs, here I also use is ant to compile java,c use gcc compile, use SMB to realize the Linux file share, Copy the installer to the SVN server, and finally open the program's location;

Start.bat

REMClean d:\yb\workspace\*REMCreate by DQREMCreate Date 2017/5/10@echo offSet_work=d:\yb\6.0\WorkspaceSet_log=d:\tools\compilerproject\alone\cleanlog.txtSet_console=%_work%\ConsoleSet_ldapserver=%_work%\LdapserverSet_package=%_work%\ PackageSet_package (WINDXLDAP) =%_work%\package (WINXLDAP)Set_trunk_win=%_work%\trunk_win.rarCD/D%_work%del/S/Q%_trunk_win%Rd/s/q%_work%\.SVNRd/S/Q%_console%Rd/S/Q%_ldapserver%Rd/S/Q%_package%Rd/s/q%_package (WINDXLDAP)%

Cleanall.bat

REMClean source code and installation packageREMCreate by DQREMCreate Date 2017/4/30Set_work=d:\yb\qhldap\6.0\srcSet_setup=d:\ Directory Services Management system \v6.0\qh-ldap_6.01.001\ installation package \LinuxREMClean 192.168.0.234:d:\yb\workspace\* D:\yb\LogRd/Q/S%_work%\LinuxREMClean Installation PackageRd/Q/S%_setup%\* REMClean 192.168.0.92:/yb/work/*CD/d D:\yb\SECURECRT SecureCRT. exe/log d:\yb\clean.txt/script scripts/aloneclean.vbs-2 [email protected]/password Qihang

Aloneclean.vbs

 # $language = "VBScript" # $interface = "1.0" CRT. screen.synchronous = True ' This automatically generated script could need to being ' edited in order to work correctly. Sub Maincrt.Screen.Send "CD/" & Chr (CRT). Screen.waitforstring "[[email protected]/]#" CRT. Screen.send "cd/y" & Chr (9) & "W" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] work]#" CRT. Screen.send "Rm-rf S" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] work]#" CRT. Screen.send "rm 0" & Chr (8) & "=-" & Chr (8) & Chr (8) & "=" & Chr (8) & "-rf o" & Chr (9) &am P Chr (the CRT). Screen.waitforstring "[[email protected] work]#" CRT. Screen.send "Rm-rf o" & Chr (8) & "P" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] work]#" CRT. Screen.send "Rm-rf C" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] work]#" CRT. Session.Disconnectcrt.QuitEnd Sub 

Teasefile.bat

REM Send source code              REM Create by DQ REM Create Date 2017/5/10 REM Send to Linux CD /dD:\yb\ "D:\yb\QHLDAP\6.0\src\trunk_lin.gzip" sftp://root: Qihang@192.168.0.92/ .. /yb/workrem  run ' gunzipscript ' scriptsecurecrt. exe  /script  Scripts/gunzipscript.vbs  

Gunzipscript.vbs

# $language = "VBScript" # $interface = "1.0" CRT. screen.synchronous = True ' This automatically generated script could need to being ' edited in order to work correctly. Sub Maincrt.Screen.Send "CD/" & Chr (CRT). Screen.waitforstring "[[email protected]/]#" CRT. Screen.send "cd/yb/w" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] work]#" CRT. Screen.send "tar xvf T" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] work]#" CRT. Screen.send "ls" & Chr (the CRT). screen.waitforstring CHR & "[M[[email protected] work]#" CRT. Screen.send "Rm-rf T" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] work]#" CRT. Screen.send "ls" & Chr (the CRT). Session.Disconnectcrt.QuitEnd Sub

Output_linux.bat

rem Stop mstsc.exe; Open Release folder Rem Create by Dqrem create date 2017/5/2rem run ' compilerscript ' scirptcd/d D:\yb\SecureCRTSecureCRT. EXE  /script  scripts/antcompilerscript.vbs  -2 [email protected]/password Qihangrem long-distance copy Installation projectnet use */del/ynet use \\192.168.0.92\public [email protected]/user:rootcopy \\192.168.0.92\public \* d:\ Directory Services management System \v6.0\qh-ldap_6.01.001\ installation package \linux\setuprem Open installation Project dir d:start d:\ directory service Management system \v6.0\ Qh-ldap_6.01.001\ installation Package \linux@exit

Antcompilerscript.vbs

# $language = "VBScript" # $interface = "1.0" CRT. screen.synchronous = True ' This automatically generated script could need to being ' edited in order to work correctly. Sub Maincrt.Screen.Send "CD/" & Chr (CRT). Screen.waitforstring "[[email protected]/]#" CRT. Screen.send "CD" & Chr (8) & Chr (8) & "Chmod-r 777/y" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected]/]#" CRT. Screen.send "Cd/yb" & Chr (9) & "Comp" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] compilerproject]#" CRT. Screen.send "Ant-f init.xml" & Chr (the CRT). Screen.waitforstring "[[email protected] compilerproject]#" CRT. Screen.send "Ant-f Ld" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] compilerproject]#" CRT. Screen.send "CD/" & Chr (CRT). Screen.waitforstring "[[email protected]/]#" CRT. Screen.send "Chmod-r 777/y" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected]/]#"CRT. Screen.send "cd/yb/work/package-x/qhldap-web/web/web/webapp/ldapproject/web-inf/classes" & Chr (9) & Chr (13) Crt. Screen.waitforstring "[[email protected] classes]#" CRT. Screen.send "Rm-f *.jar" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] classes]#" CRT. Screen.send "Chmod-r 777/y" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] classes]#" CRT. Screen.send "Cd/yb" & Chr (9) & "W" & Chr (9) & "S" & Chr (9) & "QH" & Chr (9) & Chr (All) Crt.s Creen. Waitforstring "[[email protected] qhldap-1.0]#" CRT. Screen.send "ls" & Chr (the CRT). screen.waitforstring CHR & "[m[[email protected] qhldap-1.0]#" CRT. Screen.send "./ldap-" & Chr (9) & ". Sh" & Chr (CRT). Screen.waitforstring "[[email protected] qhldap-1.0]#" CRT. Screen.send "cd/y" & Chr (9) & "W" & Chr (9) & "P" & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] Package-x]# "CRT. Screen.send "./package." & Chr (9) & Chr (CRT). Screen.waitforstring "[[email protected] package-x]#" CRT. Screen.send chr (CRT). Screen.waitforstring "[[email protected] package-x]#" CRT. Screen.send chr (CRT). Session.Disconnectcrt.QuitEnd Sub

Here's how to use Samba to share files

Installing Samba

1) Check if RPM–QA is installed | grep Samba

2) Modify/etc/samba/smb.conf

Workgroup = Workgroup

Hosts allow=192.168.0.234

3) At the end of the file, add

[Public]

Comment=public Stuff

Path =/yb/wroktest

Public = yes

Writable =yes

4) Restart Services: Service SMB restart

5) Create Samba client: Smbpasswd–a Root Enter the password after entering it the root must already exist in the system

6) Under Windows Link, start running, enter the Linux IP: \\192.168.0.92 Enter the SMB account password.

Linux version Baseline automation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.