peterkeen / dokuen

A personal PaaS for mac and linux
548 stars 19 forks source link

Unknown sub-command #21

Open jphastings opened 11 years ago

jphastings commented 11 years ago

Hi, I've been having some real trouble getting dokuen working - I've tried a couple of times and I'm getting stuck each time now on

$ ssh git@myserver dokuen create --application=<my application>
FATAL: unknown gitolite sub-command

I'm hoping someone will have some advice - I've tried everything I can think of! (see below for my steps so far)

Host System: Mac OS X 10.8 (Mountain Lion)

  1. Install the OS X gcc installer
  2. Install RVM multiuser edition (installs to /usr/local/rvm) so I have a ruby for my usual user account, and dokuen for the git user.
  3. Create a git user (using the OS X users GUI)
  4. Add my own username and the git username to the user group rvm
  5. Install ruby 1.9.3-p194 (I've had problems with rvm's version of the new stable ruby, p286) rvm install 1.9.3-p194
  6. Log into the shell as the git user: $ login git
  7. Install gitolite: $ cd ~; git clone git://github.com/sitaramc/gitolite
  8. Follow the rest of the gitolite instructions (as per the readme)
  9. Install homebrew
  10. Install nginx (I think there's a bunch of other libraries you need to install this way, but I can't remember what they were, it's all as simple as:) brew install nginx
  11. Install dokuen gem install dokuen
  12. Follow the instructions in the dokuen caveat:
  13. Add 'dokuen' => 1, to the COMMANDS array in /Users/git/.gitolite.rc
  14. Some quirk on Mac OS X means you need to add information about the git exec path to the .gitolite.rc as well, I added the following line to the line before # ------------------ at the end of the file: $ENV{GIT_EXEC_PATH} = "/usr/libexec/git-core";
  15. Its not mentioned anywhere (that I found), but for the git pre-hooks to work with dokuen you need to change the line in .gitolite.rc which starts GIT_CONFIG_KEYS so that it allows the pre-hook: GIT_CONFIG_KEYS => 'hooks.pre' (or you could just put '*', if you're feeling permissive)
  16. I also needed to make sure my /Users/git/.profile included a line to add some bits to my PATH: PATH=$PATH:$HOME/bin:/usr/local/bin
  17. Now, cloning the gitolite admin repository from my second computer is pretty simple, but it kept asking me for a password (which is obviously incorrect, it should be using the key pair), in the end I had to add a line to my client computer's ~/.ssh/config to allow access using a specific key (see below)
  18. So now I can clone the admin repo: git clone mygit:gitolite-admin.git
  19. Now comes the part I'm stuck at. I move to my web application directory and try to start dokuen: $ cd ~/Projects/mywebapp; ssh mygit dokuen create --application=mywebapp 20 scrabble for information
  20. It looks as though dokuen isn't allowed as a sub-command: client-computer$ ssh mygit help doesn't list dokuen.
  21. Check to see that the dokuen binary exists in the right place (one install it wasn't there): ls -la /Users/git/gitolite/src/commands/ | grep dokuen - yup, it does.
  22. It looks like the dokuen executable was owned by root, not by git, so I changed that sudo chown git /Users/git/gitolite/src/commands/dokuen. No change.
  23. Really stuck. Post an issue on github (sorry!)

I really hope you can help out, this seems like it should be so easy!

Let me know if there's anything else I can help with.

Thanks,

JP

(The line in my ~/.ssh/config)

Host <hostname, eg 'mygit'>
  user git
  Hostname myserver
  IdentityFile "/Users/me/.ssh/my_key.pub"
  IdentitiesOnly yes
peterkeen commented 11 years ago

Hi JP,

I'm sorry you're having so many problems! I'm really regretting the gitolite dependency. I actually have a number of rewrites laying around that attempt to get rid of it but none ever got to the stage where I felt they were useful.

I'm not sure why you're not able to run the dokuen subcommand, it seems like everything you did is correct. Could you paste your .gitolite.rc config?

jphastings commented 11 years ago

No worries at all, I've had a world of trouble trying to get mason to work doing something exactly like this, so I'm just pretty excited someone has already put something together! :)

My .gitolite.rc looks like this:

# configuration variables for gitolite

# This file is in perl syntax.  But you do NOT need to know perl to edit it --
# just mind the commas, use single quotes unless you know what you're doing,
# and make sure the brackets and braces stay matched up!

# (Tip: perl allows a comma after the last item in a list also!)

# HELP for commands (see COMMANDS list below) can be had by running the
# command with "-h" as the sole argument.

# HELP for all the other external programs (the syntactic sugar helpers and
# the various programs/functions in the 8 trigger lists), can be found in
# doc/non-core.mkd (http://sitaramc.github.com/gitolite/non-core.html) or in
# the corresponding source file itself.

%RC = (
    # if you're using mirroring, you need a hostname.  This is *one* simple
    # word, not a full domain name.  See documentation if in doubt
    # HOSTNAME                  =>  'darkstar',
    UMASK                       =>  0077,

    # look in the "GIT-CONFIG" section in the README for what to do
    GIT_CONFIG_KEYS             =>  'hooks.pre',

    # comment out if you don't need all the extra detail in the logfile
    LOG_EXTRA                   =>  1,

    # settings used by external programs; uncomment and change as needed.  You
    # can add your own variables for use in your own external programs; take a
    # look at the info and desc commands for perl and shell samples.

    # used by the CpuTime trigger
    # DISPLAY_CPU_TIME          =>  1,
    # CPU_TIME_WARN_LIMIT       =>  0.1,
    # used by the desc command
    # WRITER_CAN_UPDATE_DESC    =>  1,
    # used by the info command
    # SITE_INFO                 =>  'Please see http://blahblah/gitolite for more help',

    # add more roles (like MANAGER, TESTER, ...) here.
    #   WARNING: if you make changes to this hash, you MUST run 'gitolite
    #   compile' afterward, and possibly also 'gitolite trigger POST_COMPILE'
    ROLES                       =>
        {
            READERS             =>  1,
            WRITERS             =>  1,
        },
    # uncomment (and change) this if you wish
    # DEFAULT_ROLE_PERMS          =>  'READERS @all',

    # comment out or uncomment as needed
    # these are available to remote users
    COMMANDS                    =>
        {
            'dokuen'            =>  1,
            'help'              =>  1,
            'desc'              =>  1,
            # 'fork'            =>  1,
            'info'              =>  1,
            # 'mirror'          =>  1,
            'perms'             =>  1,
            # 'sskm'            =>  1,
            'writable'          =>  1,
            # 'D'               =>  1,
        },

    # comment out or uncomment as needed
    # these will run in sequence during the conf file parse
    SYNTACTIC_SUGAR             =>
        [
            # 'continuation-lines',
            # 'keysubdirs-as-groups',
        ],

    # comment out or uncomment as needed
    # these will run in sequence to modify the input (arguments and environment)
    INPUT                       =>
        [
            # 'CpuTime::input',
            # 'Shell::input',
            # 'Alias::input',
            # 'Mirroring::input',
        ],

    # comment out or uncomment as needed
    # these will run in sequence just after the first access check is done
    ACCESS_1                    =>
        [
        ],

    # comment out or uncomment as needed
    # these will run in sequence just before the actual git command is invoked
    PRE_GIT                     =>
        [
            # 'renice 10',
            # 'Mirroring::pre_git',
            # 'partial-copy',
        ],

    # comment out or uncomment as needed
    # these will run in sequence just after the second access check is done
    ACCESS_2                    =>
        [
        ],

    # comment out or uncomment as needed
    # these will run in sequence after the git command returns
    POST_GIT                    =>
        [
            # 'Mirroring::post_git',
            # 'CpuTime::post_git',
        ],

    # comment out or uncomment as needed
    # these will run in sequence before a new wild repo is created
    PRE_CREATE                  =>
        [
        ],

    # comment out or uncomment as needed
    # these will run in sequence after a new wild repo is created
    POST_CREATE                 =>
        [
            'post-compile/update-git-configs',
            'post-compile/update-gitweb-access-list',
            'post-compile/update-git-daemon-access-list',
        ],

    # comment out or uncomment as needed
    # these will run in sequence after post-update
    POST_COMPILE                =>
        [
            'post-compile/ssh-authkeys',
            'post-compile/update-git-configs',
            'post-compile/update-gitweb-access-list',
            'post-compile/update-git-daemon-access-list',
        ],
);

$ENV{GIT_EXEC_PATH} = "/usr/libexec/git-core";

# ------------------------------------------------------------------------------
# per perl rules, this should be the last line in such a file:
1;

# Local variables:
# mode: perl
# End:
# vim: set syn=perl:
teamon commented 11 years ago

See https://github.com/peterkeen/dokuen/issues/18