Cloud Runner is a simple microservice that builds and runs a gcloud run deploy command against a given GCP project ID. For flag support please visit the wiki.
| Name | Description | Required | Notes |
|---|---|---|---|
API_KEY |
Validated for Create/Delete operations | ✔️ | |
SQL_HOST |
SQL host | If not set will default to local sqlite DB | |
SQL_NAME |
SQL database name | If not set will default to local sqlite DB | |
SQL_PASS |
SQL password | If not set will default to local sqlite DB | |
SQL_USER |
SQL username | If not set will default to local sqlite DB |
make buildmake testThe following will show you how to run Cloud Runner locally and onboard your first account! Running locally will by default create a SQLite DB named cloud-runner.db in the current directory.
- Run cloud-runner
$ export API_KEY=test
$ make run- Create an account. Cloud Runner connects to Spinnaker's fiat (at http://spin-fiat.spinnaker:7003) when deploying to GCP to verify the current user has read and write access to the account. The user is defined in the
X-Spinnaker-Userrequest header. When onboarding an account into Cloud Runner make sure to define the read and write groups correctly! If noaccountfield is provided one will be generated in the formatcr-<GCP_PROJECT_ID>.
$ curl -H "API-Key: test" localhost:80/v1/credentials -d '{
"account": "test-account-name",
"projectID": "test-project-id",
"readGroups": [
"test-group"
],
"writeGroups": [
"test-group"
]
}' | jqYou should see the response
{
"account": "test-account-name",
"projectID": "test-project-id",
"readGroups": [
"test-group"
],
"writeGroups": [
"test-group"
]
}- List credentials
$ curl localhost:80/v1/credentials | jq
You should see the response
{
"credentials": [
{
"account": "test-account-name",
"projectID": "test-project-id",
"readGroups": [
"test-group"
],
"writeGroups": [
"test-group"
]
}
]
}To generate CURL commands to create and monitor a deployment, reference the swagger YAML at api/swagger.yaml.
