Automated web publishing and automated web Publishing
</Pre> based on the current business version, maven and tomcat are used <p> </p> <p> if we use Jenkins for release, but there are some problems, the learning time is required. </p> <p> Based on our project, I used python to automatically build the publishing environment. </p> the script is as follows: </p> <pre code_snippet_id = "498203" snippet_file_name = "blog_20151127_2_7484436" name = "code" class = "python"> #! /Usr/bin/env python #-*-coding: UTF-8-*-import sysimport osimport ConfigParserhomedir = OS. getcwd () print homedirconfig = ConfigParser. configParser () config. read ("config. propties ") user_name = config. get ("SVN", "user_name "). decode ('utf8 '). encode ('cp936') user_password = config. get ("SVN", "user_password "). decode ('utf8 '). encode ('cp936') check_out_dir = homedirlog_name = config. get ("SVN", "log_name "). decode ('utf8 '). encode ('cp936') script_dir = homedirpkg_name = homedir + OS. path. sep + "mabaobang-web" + OS. path. sep + "target" + OS. path. sep + "mabaobang-web.war" rmote_ip = config. get ("SVN", "rmote_ip") rmote_user = config. get ("SVN", "rmote_user") rmote_passwd = config. get ("SVN", "rmote_passwd") print "pkg_name", pkg_namescript_dir = config. get ("SVN", "script_dir "). decode ('utf8 '). encode ('cp936 ') command = "svn log-v -- xml" + check_out_dir + ">" + log_name + "-- username" + user_name + "-- password" + user_passwordos.system (command) OS. chdir (check_out_dir) print OS. path. abspath (". "). decode ('cp936 '). encode ('utf8 ') command1 = "svn update" + check_out_dir + "-- username" + user_name + "-- password" + user_password + "-- no-auth-cache -- non-interactive -- trust-server-cert "OS. system (command1) OS. system ("mvn clean: clean package"); file_object = open('123123.txt ', 'w') file_object.write ("open 192.168.15.234 \ n ") file_object.writelines ("put" + pkg_name + "\ n") # file_object.writelines (file. newlines) file_object.writelines ("bye \ n") # file_object.writelines (file. newlines) # file_object.writelines (file. newlines) file_object.flush () file_object.close () if OS. path. exists (pkg_name): OS. chdir (homedir) try: command_sftp = "ftp.exe-l" + rmote_user + "-pw" + rmote_passwd + "-B 123123.txt" OS. system (command_sftp) failed t Exception, e: print "done" finally: command_ssh = "ssh.exe-ssh-pw" + rmote_passwd + "" + rmote_passwd + "@ 192.168.15.234 '/home/momabo/deploy. sh' "OS. system (command_ssh)
The configuration file is as follows:
[SVN]user_name=111111user_password=000000#check_out_dir=D:\11111\1111-parentlog_name=E:\log.log#out_put_dir=D:\1111\111-parent#war_name=D:\11111111-parent\11111111111111-web\target\111111111-web.warrmote_ip=192.168.15.234rmote_user=xxxx
Two open source soft sftp.exe http://the.earth.li /~ Sgtatham/putty/0.63/x86/psftp.exe
And ssh.exe http://the.earth.li /~ Download sgtatham/putty/0.63/x86/plink.exe.
Automatically publish background scripts
! /Bin/bash ###? Busy? Mei? Cat? What's wrong ???? Lou Lu? War path? Lu ?? Donkey? Recording ??? Busy ### busy ?? Lu Mao ??? Lou Lu? Miss Girl ?? Road cap ?? Lu ?? Donkey? ?? Collect USER_HOME =/home/3213123TOMCAT_HOME =$ {USER_HOME}/tomcat #? Lou ?? Why ?? Donkey? Recorded APP_HOME =$ {TOMCAT_HOME}/webapps/12313123-webCONF_FILE =$ {APP_HOME}/WEB-INF/classes/config. propertiesIP_ADD = 127.0.0.1MYSQL _ USER_NAME = rootMYSQL_USER_PASSWD = synchronized upload upload_dir =/home/312312312/upload ### what ?? Lu Mao ??? Lou Lu? Miss Girl ?? Road cap ?? Lu ?? Donkey? ?? Collapse if [! -F $ {USER_HOME}/mabaobang-web.war]; then echo-e "\ 033 [31 m ERROR: Pkg $ {USER_HOME}/mabaobang-web.war is not exist. \ 033 [0 m "exit 1fi ### what? Lu mg Lu? Close? Lulu magnesium? Cap $ {TOMCAT_HOME}/bin/shutdown. sh ####? Lou Lu media? Luyun lujiao Road? Topic ????? If [! -D $ {APP_HOME}]; then echo-e "\ 033 [31 m ERROR: Dir $ {APP_HOME} is not exist. \ 033 [0 m "exit 1 else rm-rf $ {APP_HOME}/* fimv $ {USER_HOME}/1312313-web.war $ {APP_HOME}/cd $ {TOMCAT_HOME}/webapps/m312321g-webjar- xvf $ {APP_HOME}/3138243-web.war ##?? Why ?? Blind ???? Recording magnesium dos2unix $ {CONF_FILE }##?? Why ?? Blind ???? Recorded magnesium sed-I "s/\/127.0.0.1/\/$ {IP_ADD}/g" $ {CONF_FILE} sed-I "s/^ [] * jdbc_username =. */jdbc_username =$ {MYSQL_USER_NAME}/g "$ {CONF_FILE} sed-I" s/^ [] * jdbc_password =. */jdbc_password =$ {MYSQL_USER_PASSWD}/g "$ {CONF_FILE}
Web websites perform automated tests. Do experienced users recommend tools?
You have asked the right person, ruby + watir or Selenium. I am writing a web automation testing framework. Haha
Is there any free industrial control configuration software that requires no purchase authorization and is used for WEB publishing of existing automation systems and viewing production status on the webpage?
I think you can use the D version for learning, but it is not easy for others to compile such software if they are used for production and operation or if they spend money to buy genuine ones.