Always wanted to implement automatic deployment, which is said in the automatic deployment, refers to the click of a button (or timed execution), so that the computer will be the latest application published to the appropriate environment (UAT or PRD).
The meaning of automatic deployment
Automatic deployment eliminates tedious manual release steps, and, if configured properly, the execution stability (success rate) of the release is higher.
This has several meanings:
- Avoid tedious manual publishing. In the development phase, the user is always more anxious than us, we hope to see the newly developed modules quickly, and conduct appropriate UAT testing. This may require us to complete the development and testing of a module and publish it to the UAT environment in a timely manner. At this point, if we configure the scheduled automatic deployment. This will avoid tedious work and do more with less.
- Rigorous. If the process of publishing is more complex, the release process will inevitably lead to careless mistakes by manual manipulation. The use of computers to help dispatch the various actions, if the configuration is correct, then the likelihood of errors will be greatly reduced, unless the original assumptions of the environmental parameters changed.
Common software combinations We develop are: Java + SVN (version control tool) + ANT (Compile package tool) + Weblogic (Web Server).
So I'm also using this set of combinations as an idea, plus the automatic deployment Tool Jenkins.
The tools you use are different, but the tools are used or follow the same specifications, so switching should be possible. For example, the Web server you are using now is weblogic and needs to be switched to Tomcat or JBoss, which should not be a problem (but I haven't tried--!).
Previous assumptions have been made, but stuck on the WebLogic update issue: How to use scripts to let WebLogic update our application.
Recently looked closely at the WebLogic document, found calling WebLogic. Deployer is good enough to meet my needs.
The idea of publishing
So, the idea of automatic deployment is that the total dispatcher using Jenkins as a task
- Jenkins first calls the SVN update code.
- Jenkins then calls Ant to make the project into a war. and copied to the specified directory, where the specified directory refers to the directory where the Web server reads the source files (this process can be done by Ant's Build.xml or by a separate script).
- Jenkins then invokes a well-written script to trigger the Web server update application. For example, using WebLogic, you can use WebLogic in this script. Deployer Update the application.
How to update an WebLogic deployed application
Weblogic. Deployer is class, so it is necessary to attach the corresponding Classpath,jar in $wls_home/server/lib/weblogic.jar.
I use redeploy's parameters to implement the update application:
JAVA-CP $WLS _home/server/lib/weblogic.jar WebLogic. deployer-adminurl T3://xx.xx.xx.xx:7001-username Weblogicusername-password weblogicpassword-name Appname-redeploy
Call Redeploy App
PS, attached WebLogic. Deployer's Help information:
Usage:java WebLogic. Deployer [options] [action] [Deployment units (s)]
where options include:
-help Print The standard usage message.
-version Print version information.
-adminurl <<protocol>://<server>:<port>> [option] Administration
Server Url:default t3://localhost:7001
-username <username> [option] User name
-password <password> [option] password for the user
-userconfigfile <userconfigfile> [option] The user config file
contains the user security credentials; it
is administered by the WebLogic. Admin Tool
-userkeyfile <keyConfigFile> [option] the users key file; it is
administered by the WebLogic. Admin tool.
-distribute [Action] distribute application to the
targets.
-start [Action] makes an already distributed
application available on a target.
-stop [Action] makes an application unavailable on
targets.
-redeploy [Action] Replace a running application
partially or entirely.
-undeploy [Action] take a application out of service.
-deploy [Action] make a application available for
service.
-update [Action] Update an application configuration
In place .
-examples [option] Displays example usage of this tool.
-name <application name> [option] Defaults to the basename of the
deployment file or directory.
-targets <<target (s) >> [option] A comma separated list of targets
For the current operation. If not specified,
All configured targets is used. For a new
application, the default target is the
Administration server.
-plan <deployment plan path> [option] Specifies location of
Deployment Plan
-library [option] indicates that the unit being
deployed is a library. This option is
required when the application is a library.
-advanced Print Advanced usage options.
The optional trailing arguments is deployment units and may
Represent the archive being deployed, the name of a previously
Deployed application or a list of files for a partial redeploy operation.
(Based on Jenkins + SVN + Ant + Weblogic server) application automatic (/one-key) deployment idea