Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-13178

support relative paths in git submodule paths

XMLWordPrintable

      When we have created a submodule using the absolute URL, the submodules are usually checked out correctly but if this settings is changes to use the relative paths, it fails with eerrors like:

      Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command 'C:\Program Files (x86)\Git\bin\git.exe' submodule update --init --recursive failed with code 1. Working directory was [D:\atlassian\BAMBOO\atlassian-bamboo-4.4.5\HOME\xml-data\build-dir\TESTA-SUBMODULE2-JOB1]., stderr:
      30-Apr-2013 19:29:07 	Submodule 'new' (d:/atlassian/BAMBOO/atlassian-bamboo-4.4.5/HOME/xml-data/build-dir/new.git) registered for path 'new'
      30-Apr-2013 19:29:07 	Cloning into 'new'...
      30-Apr-2013 19:29:07 	fatal: 'd:/atlassian/BAMBOO/atlassian-bamboo-4.4.5/HOME/xml-data/build-dir/new.git' does not appear to be a git repository
      30-Apr-2013 19:29:07 	fatal: Could not read from remote repository.
      30-Apr-2013 19:29:07 	Please make sure you have the correct access rights
      30-Apr-2013 19:29:07 	and the repository exists.
      30-Apr-2013 19:29:07 	Clone of 'd:/atlassian/BAMBOO/atlassian-bamboo-4.4.5/HOME/xml-data/build-dir/new.git' into submodule path 'new' failed
      30-Apr-2013 19:29:07 	        at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:431)
      30-Apr-2013 19:29:07 	        at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runSubmoduleUpdateCommand(GitCommandProcessor.java:302)
      30-Apr-2013 19:29:07 	        at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.checkout(NativeGitOperationHelper.java:384)
      30-Apr-2013 19:29:07 	        ... 22 more
      30-Apr-2013 19:29:07 	Caused by: com.atlassian.utils.process.ProcessException: Non-zero exit code: 1
      30-Apr-2013 19:29:07 	        at com.atlassian.utils.process.PluggableProcessHandler.complete(PluggableProcessHandler.java:83)
      30-Apr-2013 19:29:07 	        at com.atlassian.utils.process.ExternalProcess.finish(ExternalProcess.java:376)
      30-Apr-2013 19:29:07 	        at com.atlassian.utils.process.ExternalProcess.execute(ExternalProcess.java:419)
      30-Apr-2013 19:29:07 	        at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:423)
      30-Apr-2013 19:29:07 	        ... 24 more
      30-Apr-2013 19:29:07 	Failed to prepare the build 'TESTA-SUBMODULE2-JOB1-7'
      

      My .gitmoduless looks like:

      [submodule "new"]
      	path = new
      	url = ../new.git
      

      This got translated to d:/atlassian/BAMBOO/atlassian-bamboo-4.4.5/HOME/xml-data/build-dir/new.git instead of https://github.com/smaiyaki/new.git. I understand that the submodule does not yet support the relative path and we believe this will be a good alternative for users.

      workaround

      1. Disable submodules
      2. crate a script task right after the checkout task to run the following commands
        git remote add origin https://github.com/smaiyaki/new.git
        git submodule update --init --recursive
        git remote remove origin
        

      Another painful workaround would be to add additional checkout tasks for each of the submodule

            Unassigned Unassigned
            smaiyaki Sultan Maiyaki (Inactive)
            Votes:
            19 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved: