2

I am trying PHPFog as a host, and I really like how it works.

I'm having an issue, however, with a recent project I pushed. The project contains a submodule, which PHPFog says it supports, however the submodule is a private repository on another server -- requiring an SSH user and password. PHPFog obviously doesn't know that, so the submodule update and init presumtively fails.

Is there a recommended workaround to using private submodules on PHPFog? Can I somehow merge the submodule into the superproject itself and push that way? Or can I reconfigure the submodule to include the SSH login information, allowing PHPfog to successfully initialize it?

EDIT: As a quick fix: I cloned into a temp directory, deleted the git folders in the submodule, and uploaded as a single repo to phpFog. This isn't the ideal solution I'm looking for.

swt83
  • 2,001
  • 4
  • 25
  • 33

2 Answers2

1

There is a new tool that allows pushing of apps with git submodules to PHP Fog. Normal git pushes will no longer fetch submodules for you and your app will fail to deploy.

See: PHP Fog's PF CLI

To push an app with git submodules first setup your account.

pf setup

List your apps to verify your logged in and get the ID of the app to clone.

pf list apps

Clone the app using the pf tool. Be sure to backup your existing git folder.

pf clone <app_id> <folder>

Here is the key to getting submodules working: You must use the update command and not the push command from now on to deploy.

pf update

Notes: The pf setup command will setup a new ssh key and automatically upload it for you. It also creates a new alias in the ssh/config for this. After using this tool you must use it for cloning your apps although you still use git commands for adding and committing changes. If you are using git submodules you have to use pf update, git push will break your app.

Tim Santeford
  • 27,385
  • 16
  • 74
  • 101
  • Do you have an opinion about what I guess is the git subtree addon? Seems to work similar to submodules but with different syntax. https://github.com/apenwarr/git-subtree – swt83 Jan 30 '12 at 18:11
  • Also, it seems like a knowledgable person could write a shell script to perform the process I used -- clone, merge submodules, commit, push, and delete. – swt83 Jan 30 '12 at 18:16
  • I haven't seen git-subtree but it looks like its worth a shot. I have inside information that PHPFog is leaning heavily towards recommending users to use Composer. You could create a composer.json manifest that references the private repo then run `composer.phar update` to pull in changes. see: http://packagist.org/about-composer – Tim Santeford Jan 30 '12 at 19:00
0

At this time PHPFog does not support private submodules. You can use something like composer to manage the package locally and push the finished product to PHPFog.

Rich H.
  • 154
  • 2