{"id":22548270,"url":"https://github.com/ewilan-riviere/drone","last_synced_at":"2025-10-16T02:41:13.620Z","repository":{"id":246789994,"uuid":"822190317","full_name":"ewilan-riviere/drone","owner":"ewilan-riviere","description":"Auto-deployment tool for servers.","archived":false,"fork":false,"pushed_at":"2024-07-03T07:58:59.000Z","size":643,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T09:43:22.261Z","etag":null,"topics":["autodeploy","sysadmin","tool"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ewilan-riviere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-30T14:31:33.000Z","updated_at":"2024-07-03T07:59:02.000Z","dependencies_parsed_at":"2024-07-06T10:48:53.025Z","dependency_job_id":null,"html_url":"https://github.com/ewilan-riviere/drone","commit_stats":null,"previous_names":["ewilan-riviere/drone"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewilan-riviere%2Fdrone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewilan-riviere%2Fdrone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewilan-riviere%2Fdrone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewilan-riviere%2Fdrone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ewilan-riviere","download_url":"https://codeload.github.com/ewilan-riviere/drone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245999602,"owners_count":20707570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autodeploy","sysadmin","tool"],"created_at":"2024-12-07T15:14:53.299Z","updated_at":"2025-10-16T02:41:08.550Z","avatar_url":"https://github.com/ewilan-riviere.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Drone\n\n[![version][version-src]][version-href]\n[![h3][h3-version-src]][h3-version-href]\n[![node][node-version-src]][node-version-href]\n[![License][license-src]][license-href]\n\nAuto-deployment tool for servers.\n\n\u003e [!NOTE]\n\u003e Currently support GitHub, GitLab, Bitbucket and Gitea.\n\n## Installation\n\nYou have to install Drone on your server, Docker can't be used because Drone needs to access the host machine.\n\n```bash\ngit clone https://github.com/ewilan-riviere/drone.git\ncd drone\n```\n\nCreate a `.env` file with the following content\n\n```bash\ncp .env.example .env\n```\n\nAnd fill in the environment variables:\n\n- `ENV`: environment of the application (`development`, `production`, `test`)\n- `PORT`: port of the application (into the container)\n- `HOST`: host of the application\n- `HTTPS`: enable HTTPS\n- `ENDPOINT`: endpoint of deployment\n- `SECRET_KEY`: secret key for the webhook\n- `APP_PORT`: port of the application to deploy (into the server)\n\nBest configuration for production:\n\n```bash\nENV=production\nPORT=3000\nHOST=domain.com\nHTTPS=true\nENDPOINT=/deploy\nSECRET_KEY=\nAPP_PORT=3000\n```\n\n- If you change `ENDPOINT`, you have to adapt the webhook configuration of your repository.\n- Change `APP_PORT` if you want to point to another port.\n- You can let `SECRET_KEY` empty if you don't want to use a secret key (for GitLab it's `Secret token`, for GitHub it's `Secret`, for Bitbucket it's `Secret`, for Gitea it's `Secret`). If you set a secret key, you need to set it in the webhook configuration of your repository, otherwise the deployment will not work.\n\n### Build\n\nHere I use [`pnpm`](https://pnpm.io/) as package manager, you can install `pnpm` or use [`npm`](https://www.npmjs.com/) if you prefer.\n\n```bash\npnpm install\n```\n\nBuild the application\n\n```bash\npnpm build\n```\n\n### Serve the application\n\nTo keep alive the application, you can use [`pm2`](https://pm2.keymetrics.io/).\n\n```bash\npm2 start ./dist/index.js\n```\n\n### Deploy\n\nYou can use a reverse proxy to serve the application.\n\nExample for Nginx: [nginx.conf](./docs/nginx.conf)\n\nIf you don't use `3000` as port, you have to change it in the configuration file.\n\n```nginx\nserver {\n  # ...\n\n  location / {\n    proxy_pass http://127.0.0.1:3000; # Change the port if needed\n  }\n}\n```\n\n### Logs\n\nYou can see the logs of the application with `pm2`.\n\n```bash\npm2 logs\n```\n\n## Configuration\n\nYou can add your repositories into `config/repositories.json` file.\n\n```bash\nvim config/repositories.json\n```\nThe key is the owner and the repository name separated by a slash. The value is the path to the local repository.\n\n```json\n{\n  \"owner/git-repository-name\": [\n    \"/path/to/local/repository\",\n    \"/path/to/local/repository-develop\"\n  ],\n  \"another-owner/another-git-repository-name\": \"/path/to/another/local/repository\",\n  \"alternative-owner/alternative-git-repository-name\": \"/path/to/alternative/local/repository\"\n}\n```\n\nExample for the repository \u003chttps://github.com/ewilan-riviere/drone\u003e\n\n```json\n{\n  \"ewilan-riviere/drone\": \"/path/to/drone\"\n}\n```\n\nYou can set a value as an array to deploy multiple instances of the same repository.\n\n```json\n{\n  \"ewilan-riviere/drone\": [\n    \"/path/to/drone\",\n    \"/path/to/drone-develop\"\n  ]\n}\n```\n\n## Usage\n\nWhen you push to your repository, the webhook will trigger the deployment. This option is available for GitHub, GitLab, Bitbucket and Gitea.\n\n## Configure webhooks on forges\n\n### GitHub\n\nYou can set a webhook on GitHub by going to the repository settings, then `Webhooks`, then `Add webhook`.\n\n- Payload URL: `https://drone.domain.com/deploy`\n- Content type: `application/json`\n- Secret: your secret key (if you set one)\n- Events: `Just the push event`\n\n![github-webhook](./docs/github-webhook.jpg)\n\n### GitLab\n\nYou can set a webhook on GitLab by going to the repository settings, then `Webhooks`, then `Add webhook`.\n\n- URL: `https://drone.domain.com/deploy`\n- Secret token: your secret key (if you set one)\n- Trigger: `Push events` (you can specify branches)\n\n![gitlab-webhook](./docs/gitlab-webhook.jpg)\n\n### Bitbucket\n\nYou can set a webhook on Bitbucket by going to the repository settings, then `Webhooks`, then `Add webhook`.\n\n- Title: `Drone`\n- URL: `https://drone.domain.com/deploy`\n- Secret: your secret key (if you set one)\n- Triggers: `Repository push`\n\n![bitbucket-webhook](./docs/bitbucket-webhook.jpg)\n\n## Credits\n\n- [`adr1enbe4udou1n/drone`](https://github.com/adr1enbe4udou1n/drone): original project\n\n## License\n\n[MIT](LICENSE)\n\n[version-src]: https://img.shields.io/badge/dynamic/json?label=version\u0026query=version\u0026url=https://raw.githubusercontent.com/ewilan-riviere/drone/main/package.json\u0026colorA=18181B\u0026colorB=F0DB4F\n[version-href]: https://github.com/ewilan-riviere/drone/-/tags\n[h3-version-src]: https://img.shields.io/badge/dynamic/json?label=h3\u0026query=dependencies['h3']\u0026url=https://raw.githubusercontent.com/ewilan-riviere/drone/main/package.json\u0026colorA=18181B\u0026colorB=F0DB4F\n[h3-version-href]: https://github.com/unjs/h3\n[license-src]: https://img.shields.io/github/license/ewilan-riviere/drone.svg?style=flat-square\u0026colorA=18181B\u0026colorB=F0DB4F\n[license-href]: https://github.com/ewilan-riviere/drone/blob/main/README.md\n[node-version-src]: https://img.shields.io/badge/dynamic/json?label=Node.js\u0026query=engines[%27node%27]\u0026url=https://raw.githubusercontent.com/ewilan-riviere/drone/main/package.json\u0026style=flat-square\u0026colorA=18181B\u0026colorB=F0DB4F\n[node-version-href]: https://nodejs.org/en/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewilan-riviere%2Fdrone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fewilan-riviere%2Fdrone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewilan-riviere%2Fdrone/lists"}