Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi Templates #3353

Closed

Conversation

badygin-yakov
Copy link

This is a new feature to Drone CI, allowing the use of multi templates. With this enhancement, users will have the capability to define and utilize multiple templates within their CI/CD pipelines. This is a significant addition that enhances the flexibility and extensibility of Drone CI, enabling users to streamline their pipeline definitions and improve overall workflow management.

Changes Made

  • Implemented the multi template functionality, enabling users to define and utilize multiple templates in their pipeline configuration.

Benefits

  • Enhanced Reusability: Multi templates empower users to encapsulate and reuse common pipeline segments across different projects and workflows, reducing redundancy and improving maintainability.
  • Customization: Users can mix and match templates to tailor their CI/CD pipelines according to project-specific requirements, optimizing their workflows.

Examples

template

kind: pipeline
type: docker
name: {{ .input.name }}
steps:
  - name:  {{ upper .input.stepName }}
    image: {{ .input.image }}
    commands:
      - {{ .input.commands }}

drone.yaml

kind: template
load: plugin.yaml
data:
  stepName: my_step
  image: my_image
  commands: my_command

---
kind: pipeline
type: docker
name: extra-pipeline
steps:
  - name:  extra_my_step
    image: extra_image
    commands:
      - echo "extra_command"

result pipeline

kind: pipeline
type: docker
name: defaults
steps:
  - name:  MY_STEP
    image: my_image
    commands:
      - my_command
---

kind: pipeline
type: docker
name: extra-pipeline
steps:
  - name:  extra_my_step
    image: extra_image
    commands:
      - echo "extra_command"

@CLAassistant
Copy link

CLAassistant commented Aug 16, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tdavis96
Copy link

Can the template be (automatically) downloaded from a remote github repository, allowing for centralized administration and hosting of the template?

@badygin-yakov
Copy link
Author

Can the template be (automatically) downloaded from a remote github repository, allowing for centralized administration and hosting of the template?

Absolutely, the concept of fetching templates from remote repositories is indeed valuable. However, this particular pull request is focused on introducing multi templates within a single Drone file.

@badygin-yakov
Copy link
Author

Hi, @tphoney! Can you review this PR?

@hitesharinga hitesharinga changed the base branch from master to drone October 4, 2023 02:46
@alikhil
Copy link

alikhil commented Nov 2, 2023

@tphoney
Any chance that this PR will be merged?

@bot2-harness
Copy link
Collaborator

This PR has been automatically closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants