Trigger build manually

Hi, I’m trying to move my project from Jenkins to Drone.
I have some use cases that I need to exist in order to do that.

  1. We have for each branch four different builds, each one taking care of different aspects, is there other way then putting all the types in the same .drone.yml files?

  2. Our builds use a library of other Jenkins files that we wrote, how can I do something like that?
    The only solution I can think about is to create plugin for each Jenkins file, is there a better option?

  3. The most important one, we have a job that we run only manually when we want to build the artifacts and then deploy them, but I haven’t seen any way to cancel all the triggers for a pipeline, I want it to never run until I start a build, is it possible somehow?

I would really be happy if you could help me, Drone seems like a great tool, but in order to use it I need it to fit our needs.

Thanks ahead, Tom

We have for each branch four different builds, each one taking care of different aspects, is there other way then putting all the types in the same .drone.yml files?

Yes you can define multiple pipelines (one for each branch)

And you can limit which pipeline(s) executes and when:

Our builds use a library of other Jenkins files that we wrote, how can I do something like that? The only solution I can think about is to create plugin for each Jenkins file, is there a better option?

Drone does not have any concept of imported or shared configuration files. You can use plugins to encapsulate and share steps. Some teams use our extension feature to extend the yaml, and you certainly could extend the yaml to support imports:

We also have a Starlark scripting extension. Starlark is a scripting language created for the Bazel project. You can use Starlark as an alternative configuration format to yaml, and Starlark and the Starlark extension support shared imports:

The most important one, we have a job that we run only manually when we want to build the artifacts and then deploy them, but I haven’t seen any way to cancel all the triggers for a pipeline, I want it to never run until I start a build, is it possible somehow?

You can manually trigger a build using the CLI or the API. I am not sure I fully understand the requirement to cancel triggers. Perhaps you can provide some more details?

Yes you can define multiple pipelines (one for each branch)

I don’t need pipeline for each branch, I need multiple pipelines for the same branch.
I’m asking if there’s a way to write multiple .drone.yml files.
In Jenkins we write groovy, is there’s an option to run groovy within Drone?
I will also look at Starlark.

You can manually trigger a build using the CLI or the API. I am not sure I fully understand the requirement to cancel triggers. Perhaps you can provide some more details?

We have a branch for each release, we want to build a release only manually, because we must test our application a lot before deploying it.
We don’t want to build this branch every push or merge in it.
I saw the option to trigger build using the API or the CLI, but it’s not convenient.
I’m looking for a way to prevent a certain pipeline until I tell it to run.
Is there an option to do something like that?

If you need more information I can add.
Thanks!

Yes, this is possible, you can define as many pipelines as you want, each with different execution criteria. However, instead of using multiple files, you defines multiple pipelines in a single file using yaml’s multi-document syntax.

Yes, this is possible. You can specify that a pipeline should only execute when the event type is custom. The custom event type is only assigned when a pipeline is manually executed.

The custom event type is only assigned when a pipeline is manually executed.

Is this possible from the UI itself?

I have another question, is there a way to pass parameters to a build using the UI?
We pass some multiple parameters, and to do it using API is pretty tough.

Thank you very much!

If the goal is to test code and then manually execute a deployment, why not use Drone’s deployment / promotion feature?

You can execute deployments from the user interface:

I have another question, is there a way to pass parameters to a build using the UI?
We pass some multiple parameters, and to do it using API is pretty tough.

Yes, this is available when using the deployment wizard.

Yes, this is available when using the deployment wizard.

This is perfect!
Is there a way to have a constant set of keys?

For example:
We have a name for each environment, we use this environment name in the docker image name.
Let’s say the environment is test1, so the docker image name will bel: myapp-test1.
Can I use the target name as a parameter in the build?