Skip to content

Fail to deploy from Windows #7

Open

Description

@horace-yip

When trying to deploy in Windows, I receive the following error:
"Error: In packages\joke\joke: 'build.sh' won't run on this platform and no 'build.cmd' is provided"

Also tried with Ubuntu on Windows, the build.sh also fails:
"/bin/bash: ./build.sh: /bin/bash^M: bad interpreter: No such file or directory

Failures:
Error: While deploying action 'joke/joke': './build.sh' exited with code 126"

Activity

  1. rabbah commented on Jun 23, 2022

    @rabbah
    Contributor

    Thanks @horace-yip - we will need to create a build.cmd for windows to be the equivalent of the bash script. Will send a PR.

  2. horace-yip commented on Jun 23, 2022

    @horace-yip
    Author

    Thanks @rabbah. I look forward to the build.cmd.

    I managed to deploy with Ubuntu on Windows. The trick is ensure the bash script line terminated with LF, not CRLF.

  3. rabbah commented on Jun 25, 2022

    @rabbah
    Contributor

    Also using --remote-build to trigger a build remotely would avoid any local environment divergence with cloud environment.

  4. mdu-adam-williamson commented on Dec 13, 2022

    @mdu-adam-williamson

    I am getting the above error on windows even when using --remote-build any ideas how to remote build on windows?

    Command:
    doctl serverless deploy sample-functions-python-jokes --remote-build
    Error:
    Error: In packages\joke\joke: 'build.sh' won't run on this platform and no 'build.cmd' is provided

  5. mdu-adam-williamson commented on Dec 13, 2022

    @mdu-adam-williamson

    For anyone in the future reading this, I created an empty file named build.cmd next to build.sh in the same folder.
    With that empty file present it now works. Windows hey!

  6. joshuaauerbachwatson commented on Dec 13, 2022

    @joshuaauerbachwatson

    The fact that --remote-build does not seem to affect the logic which decides whether build.cmd or build.sh is appropriate strikes me as a bug in digitalocean/functions-deployer. I've opened issue digitalocean/functions-deployer#39 accordingly.

  7. mautabar commented on Jan 22, 2023

    @mautabar

    Open build.sh in notepad++

    Edit --> EOL Conversion --> UNIX/OSX Format

    and then save the file

    deploy: doctl serverless deploy sample-functions-python-jokes --remote-build

    as described here: https://stackoverflow.com/a/24013333

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