scm-sync-configuration-plugin icon indicating copy to clipboard operation
scm-sync-configuration-plugin copied to clipboard

not-a-git-repo

Open jkiddo opened this issue 6 years ago • 0 comments

Hi -

I've used this plugin to backup my Jenkins configurations.

Now, I've run into a problem trying to restore my jenkins configuration in a new Jenkins instance. The new jenkins instance is a vanilla docker jenkins instance from jenkinsci/jenkins. All I've done is to start the docker image and installed the SCM plugin + certificates to the github repo. In the log I can see the following when trying to restore the configurations on my new instance using this plugin:

[INFO] Working directory: /var/jenkins_home/scm-sync-configuration/checkoutConfiguration
[INFO] Executing: /bin/sh -c cd '/tmp' && 'git' 'ls-remote' '[email protected]:someSecretUser/automate.git'
[INFO] Working directory: /tmp
[INFO] Executing: /bin/sh -c cd '/var/jenkins_home/scm-sync-configuration/checkoutConfiguration' && 'git' 'log' '-n1' '--date-order' 'master'
[INFO] Working directory: /var/jenkins_home/scm-sync-configuration/checkoutConfiguration
  • nothing more happens and nothing is restored.

If I try to re-run those commands myself the following happens

$ cd /var/jenkins_home/scm-sync-configuration/checkoutConfiguration
$ /bin/sh -c cd '/tmp' && 'git' 'ls-remote' '[email protected]:someSecretUser/automate.git'
1fe33c89d06bb2796ec8a858e56cae176f8aa164        HEAD
1fe33c89d06bb2796ec8a858e56cae176f8aa164        refs/heads/master
$ cd /tmp
$ /bin/sh -c cd '/var/jenkins_home/scm-sync-configuration/checkoutConfiguration' && 'git' 'log' '-n1' '--date-order' 'master'
fatal: Not a git repository (or any parent up to mount point /var/jenkins_home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

What just happened?

jkiddo avatar Mar 07 '18 15:03 jkiddo