Skip to content

Instantly share code, notes, and snippets.

@alexgaribay
Last active March 5, 2022 18:46
Show Gist options
  • Save alexgaribay/06ff1cca3a684871bf3a810de7069bb7 to your computer and use it in GitHub Desktop.
Save alexgaribay/06ff1cca3a684871bf3a810de7069bb7 to your computer and use it in GitHub Desktop.
Capserver definition for Drone with Github integration
{
"captainVersion": "2",
"documentation": "Taken from https://docs.drone.io/intro/gitea/single-machine/",
"displayName": "Drone.io",
"description": "Drone is a self-service Continuous Delivery platform for busy development teams",
"dockerCompose": {
"version": "2",
"services": {
"$$cap_appname-runner": {
"image": "drone/drone-runner-docker:$$cap_drone_runner_version",
"notExposeAsWebApp": "true",
"restart": "always",
"environment": {
"DRONE_RPC_PROTO": "$$cap_drone_server_proto",
"DRONE_RPC_HOST": "$$cap_drone_server_host",
"DRONE_RPC_SECRET": "$$cap_drone_rpc_secret",
"DRONE_RUNNER_CAPACITY": "$$cap_drone_runner_capacity",
"DRONE_RUNNER_NAME": "${HOSTNAME}"
},
"volumes": [
"/var/run/docker.sock:/var/run/docker.sock"
]
},
"$$cap_appname": {
"depends_on": [
"$$cap_appname-runner"
],
"image": "drone/drone:$$cap_drone_version",
"containerHttpPort": "80",
"volumes": [
"$$cap_appname-server:/data"
],
"restart": "always",
"environment": {
"DRONE_GITHUB_CLIENT_ID": "$$cap_drone_github_client_id",
"DRONE_GITHUB_CLIENT_SECRET": "$$cap_drone_github_client_secret",
"DRONE_SERVER_PROTO": "$$cap_drone_server_proto",
"DRONE_SERVER_HOST": "$$cap_drone_server_host",
"DRONE_RPC_SECRET": "$$cap_drone_rpc_secret"
}
}
}
},
"instructions": {
"start": "Drone is a self-service Continuous Delivery platform for busy development teams. It can be used with different GIT servers like gogs, gitea as well as services like gitlab and github.The process will take about a minute to finish.",
"end": "Drone is deployed and available as $$cap_appname-server.\n\n IMPORTANT: It will take up to 2 minutes for Drone for Github to be ready. Before that, you might see 502 error page.\n"
},
"variables": [
{
"id": "$$cap_drone_github_client_id",
"label": "GitHub Ouath app client id",
"description": "",
"defaultValue": "",
"validRegex": "/.{10,}/"
},
{
"id": "$$cap_drone_github_client_secret",
"label": "GitHub Ouath app client secret",
"description": "",
"defaultValue": "",
"validRegex": "/.{10,}/"
},
{
"id": "$$cap_drone_version",
"label": "drone Version",
"defaultValue": "1.7.0",
"description": "Check out their Docker page for the valid tags https://hub.docker.com/r/drone/drone/tags",
"validRegex": ""
},
{
"id": "$$cap_drone_runner_version",
"label": "drone Runner Version",
"defaultValue": "1.3",
"description": "Check out their Docker page for the valid tags https://hub.docker.com/r/drone/drone-runner-docker/tags",
"validRegex": ""
},
{
"id": "$$cap_drone_runner_capacity",
"label": "DRONE_RUNNER_CAPACITY",
"defaultValue": "2",
"description": "An integer defining the maximum number of pipelines the agent should execute concurrently. The default value is two pipelines.",
"validRegex": "/^[0-9]+$/"
},
{
"id": "$$cap_drone_server_proto",
"label": "DRONE_SERVER_PROTO",
"defaultValue": "https",
"description": "A string containing your Drone server protocol scheme. This value should be set to http or https. This field defaults to https if you configure ssl or acme.",
"validRegex": "/^([Hh][Tt][Tt][Pp]|[Hh][Tt][Tt][Pp][Ss])$/"
},
{
"id": "$$cap_drone_server_host",
"label": "DRONE_SERVER_HOST",
"defaultValue": "drone.yourhost.com",
"description": "A string containing your Drone server hostname or IP address.",
"validRegex": ""
},
{
"id": "$$cap_drone_rpc_secret",
"label": "secret for linking drone and agent",
"description": "some random secret here (min 10 characters)",
"defaultValue": "",
"validRegex": "/.{10,}/"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment