Using maven style artifacts for deployment with RAF 3.0.0.4
Friends,
I'm trying to accomplish automated deployments of maven artifacts using RAF.
We have three ways to access maven artifacts for deployment in our environment.
- Manually upload of the artifact named <component>1.2.3.4.ear/.war/.jar
- Use wget to download the file from a maven repository.
- Push the maven artifact to RAM and use RAM api to download the artifact as a step in RAF.
Here is my problem. Most of my developers create maven style application files for deployment such as component>-1-2-3.ear/.war file. I think there should be a better way for me to deploy this application without having to update the 1-2-3 portion /apps/properties/<component>-1-2-3.properties or /apps/media/<component>-1-2-3.ear/.war application file every time I need to deploy a new version of the application file using a RAF job on an imported environment.
How can I create a template with these requests to deploy war files that generally have the same prefix but different suffixes for file names? Using RAF I would like a good way to back up the existing war/ear files before deployment of a new application file.
Process I know today:
1. Generate Env using RAF tool.
2. Use RAF eclipse client to import exiting application file from Portal/WAS environment.
3. Update /apps/media and /apps/properties with the appropriate information for each application file <component>1-2-3.properties and corresponding <component>1-2-3.ear/.war.
4. Run execute from RAF eclipse client once. Then I can run this job from RAF web ui as needed.
I'm trying to avoid creating a script to build a .properties file for every application file that has a different suffix (1-2-3.ear/.war) when I need to deploy an application.
Please let me know if we have a solution to this already. Is there some sort of Pre/Suffix parameters that RAF 3.0.0.4 understands, in order for me to deploy subsequent maven style app files?
Thanks,
3 answers
If you are building these artifacts with maven and uploading them to a maven repository, you could use the maven-dependency-plugin to copy them and strip the version. We don't deploy using RAF, so I can't help you specifically with that, but when we package up our artifacts, we do something like:
if <maven version is snapshot> or <release version not yet built>
mvn -Dmdep.stripVersion=true -Dpkg_stg_dir=$pkg_dir -DoutputDirectory=$pkg_dir dependency:copy
if <maven version is snapshot> or <release version not yet built>
mvn install # build & test artifacts and upload to repository
mvn -Dmdep.stripVersion=true -Dpkg_stg_dir=$pkg_dir -DoutputDirectory=$pkg_dir dependency:copy
Comments
Thanks Bruce but my team will be using RAF for large scale deployments to Many complex Prod Envs so we were looking for a solution with RAF. Having said this, I like the flexibility built into maven to remove the version identifier, this is a neat idea but we also rely on the artifacts version numbers as an added check or audit that the correct code has been deployed to the portal server so we want to keep the artifact numbers in tact. But you did spark an idea, maybe I can deploy using raf by renaming the file prior to deployment to make it fit the template and then rename the artifact filename version number after the installation process has been completed but before we start up the applications.