2

I have charms stored in a private Git repository. I am trying to use juju-deployer to deploy a charm directly from that Git repository.

Let's say the Git repo is [email protected]:charms.git and in that repository I have a charm located in the trusty/rsyslog directory. I want to be able to define my juju-deployer YAML file something like this:

        "rsyslog":
      charm: rsyslog
#      branch: "[email protected]:charms.git/trusty/rsyslog@4f18be16d9f920ebb7f725998e7d2d08bbdd64fe"
      branch: "http://10.10.10.10/charms.git/trusty/rsyslog@4f18be16d9f920ebb7f725998e7d2d08bbdd64fe"
      num_units: 1
      to: 0
      options:
        messages_rotate: 30
        nova_logs: true
        syslog_rotate: 30

But I keep getting an error from juju-deployer (version 0.5.1.-3)

    Traceback (most recent call last):
  File "/usr/bin/juju-deployer", line 9, in <module>
    load_entry_point('juju-deployer==0.5.1', 'console_scripts', 'juju-deployer')()
  File "/usr/lib/python2.7/dist-packages/deployer/cli.py", line 135, in main
    run()
  File "/usr/lib/python2.7/dist-packages/deployer/cli.py", line 233, in run
    importer.Importer(env, deployment, options).run()
  File "/usr/lib/python2.7/dist-packages/deployer/action/importer.py", line 294, in run
    self.get_charms()
  File "/usr/lib/python2.7/dist-packages/deployer/action/importer.py", line 146, in get_charms
    no_local_mods=self.options.no_local_mods)
  File "/usr/lib/python2.7/dist-packages/deployer/deployment.py", line 170, in fetch_charms
    for charm in self.get_charms():
  File "/usr/lib/python2.7/dist-packages/deployer/deployment.py", line 162, in get_charms
    yield Charm.from_service(k, self.repo_path, self.series, v)
  File "/usr/lib/python2.7/dist-packages/deployer/charm.py", line 96, in from_service
    return cls(name, charm_path, branch, rev, build, store_url)
  File "/usr/lib/python2.7/dist-packages/deployer/charm.py", line 30, in __init__
    self.vcs = self.get_vcs()
  File "/usr/lib/python2.7/dist-packages/deployer/charm.py", line 44, in get_vcs
    "Could not determine vcs backend for %s" % self.branch)
ValueError: Could not determine vcs backend for http://10.10.10.10/charms.git/trusty/rsyslog

If I try using the commented out line in the YAML file above, then it gives me a different error:

2015-09-15 08:10:08  Branching charm git @ precise/rsyslog
2015-09-15 08:10:08 Could not branch git to precise/rsyslog
 fatal: repository 'git' does not exist
2015-09-15 08:10:08 Deployment stopped. run time: 0.27

This error is strange because I don't have ANY mention of precise in my YAML file.

4
  • I'm not entirely sure, that http://10.10.10.10/charms.git/trusty/rsyslog@4f18be16d9f920ebb7f725998e7d2d08bbdd64fe is a valid way to refer to a subdirectory inside a Git commit object in a repository accessible via HTTP. Sep 15, 2015 at 13:11
  • I don't think juju-deployer has a handler for http, only for git and bzr. Try to run manually git clone --depth 1 [email protected]:charms.git/trusty/rsyslog@4f18be16d9f920ebb7f725998e7d2d08bbdd64fe precise/rsyslog
    – user448115
    Sep 15, 2015 at 13:12
  • Right, I can't find any documentation about the formatting necessary to get juju-devployer to fetch charms from a git repo so I've been just messing around with the formatting. I just tried this manually and it works (githq = my git repo IP): git clone --depth 1 git@githq:charms.git trusty/rsyslog When I add the "@4f18..." it complains. Sep 15, 2015 at 13:34
  • This seems to be closer to what it is looking for: branch: "githq:charms.git/trusty/rsyslog@4f18be16d9f920ebb7f725998e7d2d08bbdd64fe" Sep 15, 2015 at 13:43

1 Answer 1

1

For git, the branch: string should:

  • begin with 'git', or
  • contain 'github.com', or
  • contain 'git.launchpad.net', or
  • be a local path to a git repo

If the string contains an '@' symbol (optional), everything after the '@' will be treated as the revision to checkout after the clone.

5
  • So if my git repository is githq.company.com then I would use: branch: githq.company.com:charms.git@4f18be16d9f920ebb7f725998e7d2d08bbdd64fe" ?? This seems to work for me except that it asks for a password. I have the keys set up properly because I can do a git clone manually. Any idea why that would be? Sep 15, 2015 at 17:27
  • Also, do you NEED to put in an "@"? What if I just want it to tak the latest? Sep 15, 2015 at 17:29
  • @user2402934 Updated the answer the make it clear that the '@' is optional. Sep 15, 2015 at 18:19
  • @user2402934 juju-deployer just shells out to git clone, so I don't know why one would work and not the other. I assume the user is the same in both cases? Sep 15, 2015 at 18:26
  • Yes - they should be the same user. I even turned off password authentication in the ssh config file PasswordAuthentication no and that made it fail immediately (without asking me for a password) so I think there may be a problem with using ssh keys from juju-deployer. I was able to work around the issue by just doing a git clone and then making the yaml file point to the local repo. I still would like to see a formatting description of the yaml file and all the possible options. Sep 15, 2015 at 19:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .