docker-deployment-action icon indicating copy to clipboard operation
docker-deployment-action copied to clipboard

Unable to locate stack file: docker-compose.yml No such file or directory (WORKAROUND)

Open diericx opened this issue 2 years ago • 1 comments

The remote will ssh in and end up at the home dir, for example. /root Currently the stack file is copied to the remote at the deploy_path location. So with a config with deploy_path: /root/my-deployment as in the example, the file will exist here: deploy_path: /root/my-deployment/docker-compose.yml

The script does not handle this. Deployment command is hard coded before the file is placed and only points to it by name https://github.com/wshihadeh/docker-deployment-action/blob/878e5822321b7acbcee5fe5fdb926d61d27656d6/docker-entrypoint.sh#L63

This means you will get errors like this if you have it place the files anywhere other than the ssh user's root:

stack_file_name: No such file or directory
docker-compose.yml: No such file or directory

WORKAROUND

Until anything changes, if you are going to copy the files, it looks like you must specify the ssh user's $HOME dir.

    - name: Deploy to Docker swarm
      uses: wshihadeh/docker-deployment-action@v1
      with:
        remote_docker_host: user@host
        ssh_private_key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }}
        ssh_public_key: ${{ secrets.DOCKER_SSH_PUBLIC_KEY }}
        deployment_mode: docker-swarm
        copy_stack_file: true
        deploy_path: /root/
        stack_file_name: docker-compose.yml
        keep_files: 5
        args: my_project

diericx avatar Apr 26 '23 23:04 diericx

Fixed here use tristiisch/docker-deployment-action@master instead

tristiisch avatar Feb 16 '24 01:02 tristiisch