Monday, September 3, 2018

Use local repo in satis repository

Leave a Comment

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": "git@example.com:/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 'git@example.com:/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.

1 Answers

Answers 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

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment