Last character removed from .drone.yml build step in 1.0.0-rc.3

Hi,

I’m trying out 1.0.0-rc.3 with the following build YAML for a Perl project:

workspace:
    base: /opt
    path: Robot

pipeline:
    build:
        image: poum/distzilla
        commands:
            # Set up the default config file
            - cp data/config.yml.example data/config.yml
            # Install dependencies quickly, don't test them
            - dzil authordeps | xargs -n 5 -P 10 cpanm --verbose --notest --quiet
            - dzil listdeps --author | xargs -n 5 -P 10 cpanm --verbose --no-interactive --notest --quiet
            # Test our own module
            - dzil smoke

The build is failing with an error:

+ dzil smok
Unrecognized command: smok.

This looks like the last character from the last build step is being ignored. On adding an extra line to the build, which is echo Done, I get the following output at the very end of the build (and the dzil smoke command succeeds):

+echo Don
Don

Thanks,
Mike

Drone takes your commands and converts them to a shell script. We can use the command line tools to see the script Drone is creating. Since you are using the legacy yaml format, the first step is to convert the yaml to the new format (drone does this automatically):

drone convert --save

Next we “compile” the yaml file the intermediate representation:

drone-yaml compile

This creates a json file with the shell script in base64 format. I took the base64 format and decoded, and this is what I am seeing:

if [ -n "$CI_NETRC_MACHINE" ]; then
cat <<EOF > $HOME/.netrc
machine $CI_NETRC_MACHINE
login $CI_NETRC_USERNAME
password $CI_NETRC_PASSWORD
EOF
chmod 0600 $HOME/.netrc
fi
unset CI_NETRC_USERNAME
unset CI_NETRC_PASSWORD
unset DRONE_NETRC_USERNAME
unset DRONE_NETRC_PASSWORD
set -e

echo + "cp data/config.yml.example data/config.yml"
cp data/config.yml.example data/config.yml

echo + "dzil authordeps | xargs -n 5 -P 10 cpanm --verbose --notest --quiet"
dzil authordeps | xargs -n 5 -P 10 cpanm --verbose --notest --quiet

echo + "dzil listdeps --author | xargs -n 5 -P 10 cpanm --verbose --no-interactive --notest --quiet"
dzil listdeps --author | xargs -n 5 -P 10 cpanm --verbose --no-interactive --notest --quiet

echo + "dzil smoke"
dzil smoke

So unfortunately this is not something I am able to reproduce at the moment. All of the source code can be found here … can you reproduce locally when running drone exec? Perhaps there is something in the code you can see that I’m missing?

Hi Brad,

After converting from the legacy YAML format and properly linting the file, the build runs fine.

I think the issue is resolved.

Thanks for your help,
Mike