Skip to content

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

@diericx

Description

@diericx

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions