简体   繁体   English

使用Jenkins在Tomcat服务器上部署后运行自动化脚本

[英]Run Automation Scripts after Deployment on Tomcat Server using Jenkins

I've deployed a servlet based web application(War file) in Tomcat server using Jankins and Maven. 我已经使用Jankins和Maven在Tomcat服务器中部署了一个基于servlet的Web应用程序(War文件)。 Now I want to run some selenium automation scripts on same application, Can it be achieved by Jenkins. 现在,我想在同一应用程序上运行一些硒自动化脚本,詹金斯能否实现? Its like Deploy web application on Sever and once deployment is successful run automation scripts using jenkins.. 就像在Sever上部署Web应用程序一样,一旦部署成功,就可以使用jenkins运行自动化脚本。

Please Help.. 请帮忙..

Two possible ways : 两种可能的方式:

1) Add post build step to your current task and run the scripts there. 1)将构建后步骤添加到当前任务中,然后在其中运行脚本。

2) Add another task ex. 2)添加另一个任务。 "app-automation-scripts" that runs every time that your current task is builded correctly. 每次正确构建当前任务时运行的“ app-automation-scripts”。

Yep, you can add maven plugin to jenkins, (installed by default most of times) then declare your project as war in pom.xml then add a post processing "maven" to your maven build config and configure it with options "war:war" -- options you can add for a maven build is: clean install build and etc. war option is for creating war files. 是的,您可以将maven插件添加到jenkins(大多数情况下默认安装),然后在pom.xml中将项目声明为war,然后在您的maven构建配置中添加后处理“ maven”,并使用选项“ war:war”进行配置“-您可以为Maven构建添加的选项是:全新安装构建等。war选项用于创建war文件。

Or: 要么:

simply run a bash command using your jenkins build configuration. 只需使用您的jenkins构建配置运行bash命令。

Former needs installation of maven plug-in and configuring it, Later needs configuring your maven to be run on the jenkins server by user named "jenkins". 前者需要安装maven插件并对其进行配置,后来需要将您的maven配置为由名为“ jenkins”的用户在jenkins服务器上运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM