Is there a way to do a build with an alternative .drone.yml?
When building our nightlies we publish artifacts to Sonatype and can do this via the tooling infrastructure for Scala. According to previous answers I googled up - we should use the drone command in combination with cron to do scheduled events.
Basically for nightlies we’d have a yml file like:
It would be a bonus if we could actually take the latest successful build and apply the deploy to it. Storing secrets in Drone is possible for our usecase if the deploy part has to be a part of the public .drone.yml.
You can retrieve the latest successful build using either the Drone API or the Drone CLI.
You can then use the build number of this build to trigger a Drone deploy event: drone deploy {org}/{project} {buildNumber} {target}. As the target you could specify ‘nightly’.
Then add a step to your .drone.yml file containing a deploy step for your nightlies and make sure you add this to the step’s conditions:
when:
event: deployment
environment: nightly
I think this will do exactly what you want, if you combine it with a scheduled cron job.