jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Cargo
  • Cargo
  • CARGO-242

cargo:smartdeploy

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.2.2
  • Component/s: Maven2
  • Labels:
    None
  • Environment:
    maven2 plugin
  • Number of attachments :
    0

Description

This goal would do what ever is necessary to take the current artifact and get
it deployed and running in the container. So, if the container is not running,
it would start it, if the artifact is not deployed, it would deploy it. If the
artifact is already deployed but is stale, it would undeploy the old one and
deploy the new one.

If the container is already running and the artifact is already deployed and up-
to-date, then it would do nothing!

The goal of staleness checking would be to skip a redeployment when one can be certain that it is not needed. In the worst case, if you cannot be certain, then it would go ahead and redeploy. I think an occasional ("unnecessary") redeployment is better than thinking something got redeployed when it was actually skipped. Nut considering that for large applications, redeployments can sometimes take a very long time, skipping an unneeded redeployment would be very useful.

Staleness detection I would guess would be done through a timestamp/file size/checksum comparison. If the current artifact can be determined to be the same as the one used for the last deployment (what is currently running), then skip the deployment (with an appropriate INFO message). Maybe something like a special 'touch file' can be used. If some form of checksum or the filesize were stored in the touch file, then even if the timestamps were the different, one could still confirm that the artifact has changed before redeploying.

However, this approach (with some extra-deployment touch files possibly having checksums) does not accomodate good interoperability with other forms of deployment (e.g., manual deployment that does not update the touch file). So there might have to be fallback of some sort. The staleness of the touchfile itself might have to be checked.

The algorithm would be something along the lines of:
1) determine what to compare with:
if touch file exists {
if is it older than timestamp of deployed directory

{ use fallback -- timestamp of deployed directory (?) }

else

{ parse touch file to get deployed timestamp, filesize, checksum }

} else

{ use fallback -- timestamp of deployed directory (?) }

2) if we have deployed checksum, compare with current artifact; if they are the same, skip re-deployment
3) compare timestamps;
4) if we have deployed filesize

{ compare filesizes if timestamps are the same AND filesizes are the same, skip re-deployment }

5) if timestamps are the same: skip re-deployment (is this enough certainly? this might kick in for an intermediately issued manual deploy)
6) deploy and update touch file (with deployed artifact filesize and/or checksum)

Issue Links

relates to

New Feature - A new feature of the product, which has yet to be developed. CARGO-1066 Easy way to clean deployments of a container

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Improvement - An improvement or enhancement to an existing feature or task. CARGO-1100 Add the ability ignore failures when undeploy fails (for example, if the application is not deployed)

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Savas Ali Tokmen added a comment - 21/Jan/13 1:06 PM

This has been fixed by CARGO-1100 as the cargo:redeploy now undeploys the deployable if already deployed, if not deploys directly

Show
Savas Ali Tokmen added a comment - 21/Jan/13 1:06 PM This has been fixed by CARGO-1100 as the cargo:redeploy now undeploys the deployable if already deployed, if not deploys directly

People

  • Assignee:
    Savas Ali Tokmen
    Reporter:
    Christopher Cobb
Vote (4)
Watch (6)

Dates

  • Created:
    06/Jan/06 12:47 PM
    Updated:
    21/Jan/13 1:07 PM
    Resolved:
    21/Jan/13 1:06 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.