Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command failed with ENOENT: deployer.phar #4

Open
lcharette opened this issue Jan 5, 2021 · 10 comments
Open

Command failed with ENOENT: deployer.phar #4

lcharette opened this issue Jan 5, 2021 · 10 comments
Labels

Comments

@lcharette
Copy link

lcharette commented Jan 5, 2021

I get this error :

Error: Command failed with ENOENT: deployer.phar deploy prod -f .github/deploy.php
spawnSync deployer.phar ENOENT

More verbose error message would be welcomed.

deploy.yml :

name: Deploy to Production

on:
  push:
    branches:
      - 'master'

jobs:
  deploy:
    name: Deploy code to prod
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: 7.4
    - name: Deploy
      uses: deployphp/action@master
      with:
        private-key: ${{ secrets.PRIVATE_KEY }}
        known-hosts: ${{ secrets.KNOWN_HOSTS }}
        dep: deploy prod -f .github/deploy.php

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@antonmedv
Copy link
Member

Hmmmmm, can tell what is wrong.

@neidiom
Copy link

neidiom commented Jan 25, 2021

@lcharette @antonmedv any ideas on how to fix this?

@antonmedv
Copy link
Member

It should be fixed in new release. Please test it.

@neidiom
Copy link

neidiom commented Jan 25, 2021

@antonmedv does not work for me, getting the following error

Error: Command failed with ENOENT: deployer.phar deploy test -v
spawnSync deployer.phar ENOENT

@antonmedv
Copy link
Member

Now such file? Does any knows how to debug it?

@neidiom
Copy link

neidiom commented Jan 26, 2021

@antonmedv if I add deployer with composer with the command below then it works. Any idea how to debug?

composer require deployer/deployer --dev

@taqie
Copy link
Contributor

taqie commented Mar 11, 2021

@antonmedv I had a similar problem. I think this bug is caused by the fact that if deployer.phar does not exist then you download it but do not give it permission to execute

#9

@dingo-d
Copy link

dingo-d commented May 6, 2021

I'm also getting similar error when trying to use the action

  with:
    private-key: ***
    dep: deploy *** *** *** staging -v
(node:2511) UnhandledPromiseRejectionWarning: Error: spawn deployer.phar ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:2511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:2511) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

My GH action looks like this

name: Deploy

on:
  # Run on pushes to `staging` branch only.
  push:
    paths-ignore:
      - '**.md'
    branches:
      - staging
      - '!main'
  # Allow manually triggering the workflow. Used for production deploy
  workflow_dispatch:

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        php: [7.4]
        node: [12.x]

    steps:
      - name: Checkout the repo
        uses: actions/checkout@v2

      - name: PHP setup
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          coverage: none
          tools: composer:v2, deployer, wp-cli

      - name: Use Node.js ${{ matrix.node }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node }}

      - name: Deploy to staging
        if: ${{ github.ref == 'refs/heads/staging' }}
        uses: deployphp/action@master
        with:
          private-key: ${{ secrets.STAGING_KEY }}
          dep: deploy ${{ secrets.ADMIN_USER }} ${{ secrets.ADMIN_EMAIL }} ${{ secrets.ADMIN_PASSWORD }} staging -v

      - name: Deploy to production
        if: ${{ github.ref == 'refs/heads/main' }}
        uses: deployphp/action@master
        with:
          private-key: ${{ secrets.PRODUCTION_KEY }}
          dep: deploy ${{ secrets.ADMIN_USER }} ${{ secrets.ADMIN_EMAIL }} ${{ secrets.ADMIN_PASSWORD }} production

@JustChapman
Copy link

@neidiom can you give an example of how you are running composer require deployer/deployer --dev? I cannot seem to get this to work, still running into the "failed with ENOENT" errors.

@zivan
Copy link
Contributor

zivan commented Sep 20, 2021

I had the same problem, created fork and opened pull request, you can check it https://github.com/zivan/action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants