Best practice to continuously integrate application updates

Kapil Thangavelu kapil.thangavelu at canonical.com
Tue Jul 8 14:43:25 UTC 2014


for continuous deployment I would  go with a post commit hook/webhook on
the repo that post ci would use the juju api to set these config variables
ie. juju set mywebapp source="https://github.com/mystuff/myapp.git@revhash"
there's extant js, python, go clients for the api.


On Thu, Jul 3, 2014 at 10:02 AM, Matt Bruzek <matthew.bruzek at canonical.com>
wrote:

> Hello Denis,
>
> After speaking with a colleague and some further reflection on this
> question I am going to retract my earlier statement and offer a different
> best practice for this situation.
>
> The upgrade-charm hook is best used for when the charm code changes. Such
> as if a new relationship was added, or there is a new interface.
> Essentially use upgrade-charm when the charm code changes, not the
> underlying application code.
>
> Instead consider adding the logic to update your web application to the
> config-changed hook. You could add a configuration option that is a URI to
> tell the charm where to get the web application code. This configuration
> option could contain a URI to a source control repository such as Bazaar or
> Github, or a directory on your computer. Users could easily change the URI
> when the web app is updated, and the config-changed hook can download the
> code and update it.
>
>
>  Here are a few examples of how you could update the charm code using a
> URI:
>
> juju set mywebapp source=”lp:~mbruzek/java/webappname/trunk”
>
> juju set mywebapp source=”git at github.com:marcoceppi/amulet.git”
>
> juju set mywebapp source=”http://website.com/mywebapp/webapp.war”
>
>
>  This option would allow the web application code to be updated when ever
> the source configuration option changes.
>
>
> I do not have a good example of this pattern at the moment. If you have
> any questions about this pattern please let me know. You can email me
> directly at matthew.bruzek at canonical.com or find me on IRC mbruzek in
> #juju on Freenode.net
>
>
>
> On Tue, Jul 1, 2014 at 9:44 PM, Denis Weerasiri <ddweerasiri at gmail.com>
> wrote:
>
>> Hi,
>> Support I have written a charm to deploy a web application on top of
>> tomcat. And now I need to redeploy the web application when I update the
>> source repository of the web application. What is the best practice to do
>> this?
>> What I have in mind is to write a new version of charm and use
>> charm-update command. So juju will re-deploy the web application.
>>
>> --
>> Thanks,
>> Denis Weerasiri
>>
>> Sent from my iPhone
>>
>> --
>> Juju mailing list
>> Juju at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/juju
>>
>>
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20140708/f6c64948/attachment.html>


More information about the Juju mailing list