This is a fork of this Drone provider which does not appear to be maintained anymore. A Terraform provider for configuring the Drone continuous delivery platform.
You can download the plugin from the Releases page, for help installing please refer to the Official Documentation.
provider "drone" {
server = "https:://ci.example.com/"
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXh0Ijoib2N0b2NhdCIsInR5cGUiOiJ1c2VyIn0.Fg0eYxO9x2CfGIvIHDZKhQbCGbRAsSB_iRDJlDEW6vc"
}
resource "drone_repo" "hello_world" {
repository = "octocat/hello-world"
visibility = "public"
}
resource "drone_secret" "master_password" {
repository = "${resource.hello_world.repository}"
name = "master_password"
value = "correct horse battery staple"
}
resource "drone_cron" "cron_job" {
repository = "${resource.hello_world.repository}"
name = "cron_job_1"
expr = "@monthly"
branch = "test"
}
provider "drone" {
server = "https://ci.example.com/"
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXh0Ijoib2N0b2NhdCIsInR5cGUiOiJ1c2VyIn0.Fg0eYxO9x2CfGIvIHDZKhQbCGbRAsSB_iRDJlDEW6vc"
}
server
- (Optional) The Drone servers url, It must be provided, but can also be sourced from theDRONE_SERVER
environment variable.token
- (Optional) The Drone servers api token, It must be provided, but can also be sourced from theDRONE_TOKEN
environment variable.
Activate and configure a repository.
resource "drone_repo" "hello_world" {
repository = "octocat/hello-world"
visibility = "public"
}
repository
- (Required) Repository name (e.g.octocat/hello-world
).trusted
- (Optional) Repository is trusted (default:false
).protected
- (Optional) Repository is protected (default:false
).timeout
- (Optional) Repository timeout (default:60
).visibility
- (Optional) Repository visibility (default:private
).configuration
- (Optional) Drone Configuration file (default.drone.yml
).
Manage a repository secret.
resource "drone_secret" "master_password" {
repository = "octocat/hello-world"
name = "master_password"
value = "correct horse battery staple"
}
repository
- (Required) Repository name (e.g.octocat/hello-world
).name
- (Required) Secret name.value
- (Required) Secret value.allow_on_pull_request
- (Optional) Allow retrieving the secret on pull requests. (Defaultfalse
)
Manage a repository cron job.
resource "drone_cron" "cron_job" {
repository = "octocat/hello-world"
name = "the_cron_job"
expr = "@monthly"
event = "push"
}
repository
- (Required) Repository name (e.g.octocat/hello-world
).name
- (Required) Cron job name.event
- (Required) The event for this cron job. Only allowed value ispush
.expr
- (Required) The cron interval. Allowed values are@daily
,@weekly
,@monthly
, and@yearly
.branch
- (Optional) The branch to run this cron job on. (Defaultmaster
)disabled
- (Optional) Is this cron job disabled?
Manage a user.
resource "drone_user" "octocat" {
login = "octocat"
}
Note: In order to use the `drone_user` resource you must have admin privileges within your Drone environment.
login
- (Required) Login name.admin
- (Required) Is the user an admin?active
- (Required) Is the user active?machine
- (Optional) Is the user a machine? (Defaultfalse
)
token
- The user's access token
To install from source:
git clone git://github.com/Lucretius/terraform-provider-drone.git
cd terraform-provider-drone
go get
go build
This project is licensed under the MIT licence.
This project uses Semantic Versioning.