I had some problems with writing a proper build script (How are commands transformed into scripts?).
It turned out that shell: /bin/bash
attribute of a step
is ignored (maybe not valid at all). It isn’t mentioned in the documentation but I found it in some post. The problem is that drone is silently ignoring this mistake.
Another example - this invokes bash:
steps:
- name: foo
image: 'gcr.io/cloud-builders/docker'
entrypoint: [ '/bin/bash','-c' ]
command: [ 'ps && echo A' ]
but this (plural commands) silently ignores the entrypoint and invokes sh
:
steps:
- name: foo
image: 'gcr.io/cloud-builders/docker'
entrypoint: [ '/bin/bash','-c' ]
commands: [ 'ps && echo A' ]
Side note - singular command
also isn’t mentioned in the documentation, I also found it in some post on this forum.
In general this will execute just fine but I would expect it to fail on validation:
steps:
- name: foo
image: 'gcr.io/cloud-builders/docker'
foobar: x
commands: [ ps ]
I would suggest stricter validation to catch such mistakes or changing drone lint
to report such issues.
$ drone --version
drone version 1.2.1