svenluijten / forge-cli

🔥 A command line utility to interact with your Laravel Forge servers, sites, and more.
https://svenluijten.com
MIT License
64 stars 14 forks source link

install:git command is not defined #11

Closed robarov closed 5 years ago

robarov commented 6 years ago

Been able to successfully execute these commands:

Now trying to install a custom git repo by running forge install:git {serverId} {siteId} --provider="custom" --repository="git@gitlab.com:companyname/groupname/reponame.git"

Following error is thrown:

  [Symfony\Component\Console\Exception\CommandNotFoundException]  
  Command "install:git" is not defined.                           
  Did you mean one of these?                                      
      install:service                                             
      uninstall:service 
svenluijten commented 6 years ago

That's odd:

λ bin/forge install:git

  [Symfony\Component\Console\Exception\RuntimeException]
  Not enough arguments (missing: "server, site").

install:git [--provider PROVIDER] [--repository REPOSITORY] [--] <server> <site>

The command seems to be working on my end. What's the output when you just do forge list?

robarov commented 6 years ago

Here's is the output for forge list

Forge CLI 0.2.0

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  authorize             Set or update the API key used in the commands.
  credentials           Show all credentials associated with your account.
  help                  Displays help for a command
  list                  Lists commands
 delete
  delete:daemon         Delete the given daemon from one of your servers.
  delete:database       Delete the given database from one of your servers.
  delete:job            Delete a scheduled job.
  delete:key            Delete an SSH key.
  delete:recipe         Delete one of your recipes.
  delete:rule           Delete a firewall rule.
  delete:server         Delete a server.
  delete:site           Delete a site.
  delete:worker         Delete the given worker.
 deploy
  deploy:site           Deploy the given website.
 disable
  disable:quickdeploy   Disable quick deployment on the given site.
 enable
  enable:quickdeploy    Enable quick deployment on the given site.
 get
  get:deploy-log        Get latest deployment log of the given site.
  get:deploy-script     Output the deployment script used for the given site.
  get:env               Show the .env file.
  get:nginx-config      Show the nginx configuration file.
 install
  install:service       Install a service on a server.
 list
  list:daemons          Show all daemons running on a server.
  list:databases        Show all databases a server.
  list:jobs             Show all jobs configured on a server.
  list:keys             Show all SSH keys installed on a server.
  list:recipes          Show all recipes in your Forge account.
  list:rules            Show all firewall rules on a server.
  list:servers          Show all servers associated with your account.
  list:sites            Show all sites installed on a server.
  list:workers          Show all workers.
 make
  make:daemon           Create and start a new daemon.
  make:database         Create a new database.
  make:job              Schedule a new job on one of your servers.
  make:key              Install a new SSH key on one of your servers.
  make:recipe           Create a new recipe.
  make:rule             Create a new firewall rule.
  make:server           Create a new server.
  make:site             Create a new site on one of your servers.
  make:worker           Create a new worker.
 reboot
  reboot:daemon         Delete the given daemon from one of your servers.
  reboot:server         Reboot one of your servers.
  reboot:service        Reboot a service on a server.
  reboot:worker         Reboot one of your workers.
 reset
  reset:deploy-state    Reset the deployment state of the given site.
 run
  run:recipe            Run one of your recipes.
 show
  show:daemon           Show information about the given daemon.
  show:database         Show information about the given database.
  show:job              Show information about a scheduled job on a specified server.
  show:key              Show information about an SSH key on a specified server.
  show:recipe           Show information about a recipe.
  show:rule             Show information about the given firewall rule.
  show:server           Show information about one of your servers.
  show:site             Show information about a site on a specified server.
  show:worker           Show information about the given worker.
 stop
  stop:service          Stop a service on a server.
 uninstall
  uninstall:service     Uninstall a service from a server.
 update
  update:deploy-script  Update the deployment script of the given site.
  update:env            Update the .env file of the given site.
  update:nginx-config   Update the nginx config script of the given site.
  update:recipe         Update the given recipe.
  update:server         Update the metadata on one of your servers.
  update:site           Update a site on a specified server.
robarov commented 6 years ago

Running forge install:gitwith -vvv returns

Exception trace:
 () at /home/forge/_devops/vendor/symfony/console/Application.php:596
 Symfony\Component\Console\Application->find() at /home/forge/_devops/vendor/symfony/console/Application.php:205
 Symfony\Component\Console\Application->doRun() at /home/forge/_devops/vendor/symfony/console/Application.php:125
 Symfony\Component\Console\Application->run() at /home/forge/_devops/vendor/sven/forge-cli/bin/forge:81
svenluijten commented 6 years ago

Hah, it's been a while since I tagged a new version (apparently). Package is obviously still in beta (and I didn't even know anyone used it at all 😅 ).

I've tagged a new version, you can try composer global update sven/forge-cli and running the command(s) 🙂

robarov commented 6 years ago

Thanks, the error message is fixed but I'm afraid a new one popped up.

Running forge install:git {serverId} {siteId} --provider="custom" --repository="git@gitlab.com:companyname/groupname/reponame.git" throws another error...

  [Themsaid\Forge\Exceptions\ValidationException]  
  The given data failed to pass validation.        
Exception trace:
 () at /home/forge/_devops/vendor/themsaid/forge-sdk/src/MakesHttpRequests.php:90
 Themsaid\Forge\Forge->handleRequestError() at /home/forge/_devops/vendor/themsaid/forge-sdk/src/MakesHttpRequests.php:75
 Themsaid\Forge\Forge->request() at /home/forge/_devops/vendor/themsaid/forge-sdk/src/MakesHttpRequests.php:33
 Themsaid\Forge\Forge->post() at /home/forge/_devops/vendor/themsaid/forge-sdk/src/Actions/ManagesSites.php:161
 Themsaid\Forge\Forge->installGitRepositoryOnSite() at /home/forge/_devops/vendor/sven/forge-cli/src/Commands/Projects/InstallGit.php:34
 Sven\ForgeCLI\Commands\Projects\InstallGit->execute() at /home/forge/_devops/vendor/symfony/console/Command/Command.php:264
 Symfony\Component\Console\Command\Command->run() at /home/forge/_devops/vendor/symfony/console/Application.php:888
 Symfony\Component\Console\Application->doRunCommand() at /home/forge/_devops/vendor/symfony/console/Application.php:224
 Symfony\Component\Console\Application->doRun() at /home/forge/_devops/vendor/symfony/console/Application.php:125
 Symfony\Component\Console\Application->run() at /home/forge/_devops/vendor/sven/forge-cli/bin/forge:91

Here's a public Gitlab repo to test with: git@gitlab.com:gitlab-org/gitlab-ce.git

I also noticed there is no way to specify a branch?

svenluijten commented 6 years ago

I'll have to take a look at this later on. I've been super busy with stuff outside open source lately, but once I find some time I'll put this at the top of my priority list 🙂

robarov commented 6 years ago

Sure, will keep an eye on this issue. Thanks!

svenluijten commented 6 years ago

Hey, I've merged #14 and tagged a new version, did that fix the issue?