Repository: cookiecutter/cookiecutter-django

Issue:
Add support for drone.io
## Description

[//]: # (What's it you're proposing? How should it be implemented?)
Drone.io support built-in
Add a .drone.yml file that allows projects to be tested/built using drone.io


## Rationale

[//]: # (Why should this feature be implemented?)
There are options for several areas of the project. Why not add some more flavor to the CI/CD options?
[Drone ](https://github.com/drone/drone) is very nice, from what I have tested. Also, it is open source, unlike most solutions out there. This makes it a candidate for baseline support.

## Use case(s) / visualization(s)

[//]: # ("Better to see something once than to hear about it a thousand times.")
Same as travis, actually. Adding some more options to people who uses other tools. This could be selected at install time.




Discussion:
Sure, feel free to send a pull request. I've heard of it, but I have no experience with this CI, I hope others may help to get the change reviewed... It sounds like it would be all in one config file so I don't mind having this.
Yes, it just requires adding a single file to the repo. The installer should ask for the option (travis, drone)? Or just add them both?
Currently it asks for Travis Y/N so this could be altered to choose a CI: Travis/Drone/None
or travis/drone/gitlab...
Since the project is using GitHub Actions now is this still relevant?
> Since the project is using GitHub Actions now is this still relevant?

Probably, since ppl might prefer to use existing ci services instead of GA.
This is still relavant, the template uses GitHub action, but the generated project might be using a totally different CI. We support a few at the moment:

https://github.com/cookiecutter/cookiecutter-django/blob/3bca38c78d77ecdd9b1ae9af52b373c4277a9c1a/cookiecutter.json#L57-L62

I'm open to add this to the existing option, assuming it's still a single file. Caveat: I've never used drone, so I can't do it... @cdvv7788 @shywn-mrk @step21 are you interested to contribute?
@browniebroke Yes I'm willing to contribute. Where can I start?

I would recommend reading our [contributing guide](https://cookiecutter-django.readthedocs.io/en/latest/contributing.html) which explains the specifics of this project. 

You can also check the GitHub docs themselves you need some help to use GitHublike for [creating a fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks) or [sending a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork).

Here are the high level changes:

1. Add the drone config files in the `{{cookiecutter.project_slug}}` directory
2. Add a new option for drone CI in `cookiecutter.json`:
    https://github.com/cookiecutter/cookiecutter-django/blob/8d64f1749461310b04a2b512184bb0623fb22ba0/cookiecutter.json#L42
3. Add the new option to the `SUPPORTED_COMBINATIONS` in tests: 
    https://github.com/cookiecutter/cookiecutter-django/blob/8d64f1749461310b04a2b512184bb0623fb22ba0/tests/test_cookiecutter_generation.py#L45
4. Make sure the drone config file(s) is/are deleted if another option is selected. We usually do that in the [post-generation hooks](https://github.com/cookiecutter/cookiecutter-django/blob/master/hooks/post_gen_project.py)
5. Update documentation

Hope that helps

Resolving patch:
diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py
--- a/hooks/post_gen_project.py
+++ b/hooks/post_gen_project.py
@@ -239,6 +239,10 @@ def remove_dotgithub_folder():
     shutil.rmtree(".github")
 
 
+def remove_dotdrone_file():
+    os.remove(".drone.yml")
+
+
 def generate_random_string(length, using_digits=False, using_ascii_letters=False, using_punctuation=False):
     """
     Example:
@@ -494,6 +498,9 @@ def main():
     if "{{ cookiecutter.ci_tool }}" != "Github":
         remove_dotgithub_folder()
 
+    if "{{ cookiecutter.ci_tool }}" != "Drone":
+        remove_dotdrone_file()
+
     if "{{ cookiecutter.use_drf }}".lower() == "n":
         remove_drf_starter_files()
 


Test patch:
diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py
--- a/tests/test_cookiecutter_generation.py
+++ b/tests/test_cookiecutter_generation.py
@@ -125,6 +125,7 @@ def context():
     {"ci_tool": "Travis"},
     {"ci_tool": "Gitlab"},
     {"ci_tool": "Github"},
+    {"ci_tool": "Drone"},
     {"keep_local_envs_in_vcs": "y"},
     {"keep_local_envs_in_vcs": "n"},
     {"debug": "y"},