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

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

Open
diericx opened this issue Apr 26, 2023 · 1 comment

Comments

@diericx
Copy link

diericx commented Apr 26, 2023

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

DEPLOYMENT_COMMAND="docker $DEPLOYMENT_COMMAND_OPTIONS stack deploy --compose-file $STACK_FILE"

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
@tristiisch
Copy link

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

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

No branches or pull requests

2 participants