Skip to content

Command "deploy" is not defined. despite including custom recipe #3153

Closed

Description

@sts-ryan-holton
  • Deployer version: 7.0.0-rc.8
  • Deployment OS: Centos 8 Stream

I'm getting the following error:

Command "deploy" is not defined.

Even though I'm including the common recipe?

<?php

namespace Deployer;

require 'recipe/common.php';
require 'deploy/recipe/sts-composer.php';
require 'deploy/recipe/sts-npm.php';
require 'deploy/recipe/sts-nuxt.php';

// Project repository
set('repository', 'git@github.com:stsonline/les-warehouse-gui.git');

// Shared files/dirs between deploys
add('shared_files', ['.env']);

// Set number of releases to keep
set('keep_releases', 2);

// Writable dirs by web server
set('allow_anonymous_stats', false);

// Site: LES Warehouse GUI (Nuxt JS)
host('2001:b98:301:1d00::a:90')
    ->set('labels', ['stage' => 'production'])
    ->set('repository', 'git@warehouse-gui:stsonline/les-warehouse-gui')
    ->set('branch', 'main')
    ->set('remote_user', 'root')
    ->set('deploy_path', '/var/www/warehouse-gui');

// Custom tasks
after('deploy:update_code', 'npm:install');
after('npm:install', 'composer:install');
after('deploy:writable', 'nuxt:generate');

Activity

  1. Schrank commented on Jun 6, 2022

    @Schrank
    Contributor

    I see two options:

    1. you unset deploy (unlikely)
    2. You don't load your deploy.php

    Just add a die('something'); to your deploy.php if this is called, then you know you are at 1. An then I would comment out each and every line until I find the scapegoat.

    Good luck!

  2. sts-ryan-holton commented on Jun 6, 2022

    @sts-ryan-holton
    Author

    If I add die('something'); right after namespace Deployer; and run vendor/bin/deployer.phar deploy stage=production then my console outputs: "something".

    I have to run vendor/bin/deployer.phar deploy stage=production as I have Deployer v6 installed globally which I cannot remove due to legacy projects requiring it.

    Besides this, if I comment out every line and keep die('something'); then I get "something" in my terminal.

    I beleive this is an error with Deployer as if I change my common recipe to the laravel recipe then it works, but my project isn't laravel, it's nuxt

    any other ideas based on this? I'm running PHP 8.0

  3. nstwfdev commented on Jun 7, 2022

    @nstwfdev

    Do you set deploy task?
    I don't see it in your deploy.php

    task('deploy', [
    'deploy:release',
       // etc
    ]);
    
  4. locked and limited conversation to collaborators on Jun 7, 2022
  5. converted this issue into a discussion #3155 on Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions