Use local repo in satis repository
Asked Answered
B

1

7

I have a server in which I have a few git repos and a satis repository setup. I'd like to setup the satis repository to list the local repos.

// satis.json
{
  "name": "NJ16 Repositories",
  "homepage": "http://packages.example.com",
  "repositories": [
        { 
            "type": "vcs", 
            "url": "https://bitbucket.org/nicholasjohn16/example.git" 
        },
        {
            "type": "vcs",
            "url": "[email protected]:/var/repo/test-repo.git"
        }
  ],
  "require-all": true,
  "output-dir": "web/"
}

When I run this, the bitbucket git repo is accessed and updated successfully, but when satis gets to building the local git repo it hangs at the following lines and doesn't continue.

Executing command (/root/.cache/composer/vcs/git-example.com--repo-test-repo.git): git rev-parse --git-dir
Executing command (/root/.cache/composer/vcs/git-example.com--repo-test-repo.git): git remote -v
Executing command (/root/.cache/composer/vcs/git-example.com--repo-test-repo.git): git remote set-url origin '[email protected]:/repo/test-repo.git' && git remote update --prune origin

I've tried using ../../repo/test-repo.git and /var/repo/test-repo.git for the repo url. When I do this, the build completes successfully, but when I try to require it with composer, I get the following error.

[RuntimeException]                                                                                                                      
Failed to execute git clone --no-checkout  "C:\wamp\www\nj16\nicholasjohn16\vendor\NicholasJohn16\test-repo" && cd /D "C:\wamp\www\nj16\nicholasjohn16\vendor\NicholasJohn16\test-repo" && git remote add composer  && git fetch composer

Cloning into 'test-repo'...                         
fatal: 'C:\wamp\www\nj16\nicholasjohn16\vendor\NicholasJohn16\test-repo' does not appear to be a git repository
fatal: Could not read from remote repository.                                                                                           

Please make sure you have the correct access rights and the repository exists.  

Though, it does make reference to the most recent commit hash so I know it's atleast fetching the repo successfully, but satis doesn't seem to have access to the data.

How can I do this correct? Any assistance is appreciated.

JFYI, git is a user and has their own ssh key which is added to authorized_users so they can clone their own repo.

Beethoven answered 25/8, 2018 at 23:6 Comment(4)
What do you get when you run $ git clone [email protected]:/var/repo/test-repo.git ?Zajac
Locally on my pc, I get a copy of the bare repo. Or do you mean on the server?Beethoven
So no errors about athentication or anything?Zajac
Nope, no errors.Beethoven
V
-1

Hi please make sure your are running proper command and path

then fallow below path

please go to you repo path (C:\wamp\www\nj16\nicholasjohn16\vendor\NicholasJohn16\test-repo)

And initialize the empty repository

git init

then set a remote also iy you want then git remote add composer github-url

Then add a branch if requires

git branch slave

Then checkout to slave branch

Then use

Note 1: please run one after one then you will get know what is the failure is

Note 2 : please re check your command which your running

Note 3 : fallow my steps

Vaunt answered 29/8, 2018 at 7:24 Comment(1)
Thanks, but that's not right. The vendor directory is managed by composer, not git. Composer should be loading the dependency there.Beethoven

© 2022 - 2024 — McMap. All rights reserved.