gitlab-ci ssh remote to server error Composer could not find a composer.json file in /app

Viewed 128

error Composer could not find a composer.json file in /app To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

image: ubuntu

before_script: - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )' - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -

  • mkdir -p ~/.ssh
  • chmod 700 ~/.ssh

  • ssh-keyscan ${ip_address} >> ~/.ssh/known_hosts

  • chmod 644 ~/.ssh/known_hosts

Test SSH: script: - ssh user@ip "cd blog && git pull && docker run --rm -v $(pwd):/app composer install && cp .env.example .env && docker-compose down && docker-compose up -d && docker-compose exec app php artisan key:generate"

0 Answers
Related