This is second post of the series- Binary deployments to OpenShift. Please visit
http://technology-edge.blogspot.in/2014/04/binary-deployment-to-openshift.html for the previous post.
Today we will see one more way of binary deployment to OpenShift. The application taken here is jbossews application.
OpenShift build and deployment mechanism internally uses rsync to sync gears with source code and built binary artifacts. When a new Gear is to be added for an auto- scaled application,
1. A new Gears is allocated and the source code i.e. Git repository is copied to new Gear using rsync. 2. Then the build is triggered on the new Gear.
3. When build completes, if Jenkins is used for build then the binary artifacts are copied to another Gear. If Jenkins is not used, this Gear is added directly to HAProxy routing configuration.
The same way can be used by application developers to quickly deploy the built artifacts to OpenShift gears externally. This is useful in case build process is externalized to the OpenShift environment.
Following is the command :-
rsync -avz
533a5c07ac9410a68b00073d@testproject-.:~/jbossews/webapps/
This command will replace the existing artifacts deployed at /jbossews/webapps with the one specified in the command.
Though this is the simplest approach to deploy binary artifacts to OpenShift there are limitations to this.
1. One will not be able to leverage the OpenShift build lifecycle i.e. various application hooks provided by OpenShift to accomplish certain things before and after the application is build and deployed.
2. The rsync directly replaces the already deployed artifacts so there is no rollback supported.
3. This approach directly pushes the binary artifact to specific Gear whereas an scaled application is deployed across Gears. So this approach does not provide straight forward way of deployment for scaled applications.
No comments:
Post a Comment