Does the build have to run on the drone.io server? Can I run the build locally? Since developers need to pass the build first before pushing code to github, I am looking for a way to run the build on developer local machine. Below is my .drone.yml file:
pipeline:
build:
image: node:latest
commands:
- npm install
- npm test
- npm run eslint
integration:
image: mongo-test
commands:
- mvn test
It includes two docker containers. How to run the build against this file in drone? I looked at the drone cli but it doesn't work in my expected way.
Drone is a modern CI/CD product built for the cloud era.
“It's free for the open-source community. So it's an open source only offering. There's no paid plan, and it's only available to public GitHub repositories,” Rydzewski explained. Rydzewski says the service was born out of a need for his own project.
@BradRydzewski comment is the right answer.
To run builds locally you use drone exec
. You can check the docs.
Extending on his answer, you must execute the command in the root of your local repo, exactly where your .drone.yml
file is. If your build relies on secrets, you need to feed these secrets through the command line using the --secret
or --secrets-file
option.
When running a local build, there is no cloning step. Drone will use your local git workspace and mount it in the step containers. So, if you checkout some other commit/branch/whatever during the execution of the local build, you will mess things up because Drone will see those changes. So don't update you local repo while the build is running.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With