Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deal with submodules that are also private #72

Open
Ma-ve opened this issue Jun 9, 2016 · 0 comments
Open

How to deal with submodules that are also private #72

Ma-ve opened this issue Jun 9, 2016 · 0 comments

Comments

@Ma-ve
Copy link

Ma-ve commented Jun 9, 2016

I've got another repo that contains my images (about 60MB of them). That repo is being submodule'd under img. A problem is that I can't use the same deploy key, because GitHub says no-no. One way to solve this is by generating another ssh key, and inputting that deploy key on the images repo.

What would be a good way of implementing this in deploy.php be? Obviously you could define a submodules array, with the submodule dir and whether or not it's private, and loop through that. That isn't nice, because you lose looseness if I introduce another submodule locally.

Another way would to ask for input from the command line, asking for the location to a second ssh key that's deployed on the second repo: StackOverflow answer for command line input here. But then you'll ask for input from the command line which is ridiculous, considering it should be an automatic deploy.

One way I've solved it right now is by replacing:

$commands[] = sprintf(
    'git submodule update --init --recursive'
);

with

$commands[] = sprintf(
    "ssh-agent bash -c 'ssh-add /var/www/.ssh/id_rsa_img; git submodule update --init --recursive'"
);

This obviously only works because I have only one submodule. /var/www/.ssh is the default dir that Apache's www-data looks for ssh keys. Anyone have any suggestions?

Maybe find a way to specify only the ssh key's name? With a strtolower from the last part of the submodule name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant