How to run Satis on a remote server?

281 Views Asked by At

There is a command to run Satis: php bin/satis build satis.json response

Satis itself lies on the server, for example, example.com/satis

How to run a command on a server remotely?

I tried to make a script with the command shell_exec('php bin/satis build satis.json response/') but encountered an error when Satis cannot log in to Git:

Scanning packages
Failed to clone the [email protected]:project/project.git repository, try running in interactive mode so that you can enter your credentials

In Git.php line 354:

  Failed to execute git clone --mirror '[email protected]:project/project
  .git' '/var/www/.composer/cache/vcs/git-gitlab.com-project.git/'                                                                         

  Cloning into bare repository '/var/www/.composer/cache/vcs/git-gitlab.com-project.git'...                                                
  Host key verification failed.                                                
  fatal: Could not read from remote repository.                                

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


build [--repository-url [REPOSITORY-URL]] [--repository-strict] [--no-html-output] [--skip-errors] [--stats] [--] [ [ [...]]]

Where is a problem?

1

There are 1 best solutions below

0
VonC On

Host key verification failed.

Probably your command is not executed with the same user as the one managing satis on the server.

That means $HOME is not the same, and $HOME/.ssh/known_hosts (used to verify the host key of the remote host) is not there or not the same.

Try at least shell_exec('id -a; env') to check out what user/environment is seen through a shell_exec() call.