Skip to content

ASP.NET Core Web App for hosting Unity3D WebGL builds with support of Continuous Delivery via Unity Cloud Webhooks.

License

Notifications You must be signed in to change notification settings

gamgaroo/Esmeralda

Repository files navigation

Esmeralda

ASP.NET Core Web App for hosting Unity3D WebGL builds with support of Continuous Delivery via Unity Cloud Webhooks.

GitHub release Build Status BCH compliance

Getting Started

Host on IIS

  1. Configure Settings/unity.json with your Unity Cloud API Key in Unity section
  2. Create a Unity Cloud webhook with URL http://{esmeralda-url}/api/builds
  3. Start new build on Unity Cloud
  4. After build completion Unity Cloud will push a notification to Esmeralda
  5. After deployment completion the build will be accessible on http://{esmeralda-url}/index.html

Run in Docker container

  1. Run docker container
docker run -e Unity:ApiKey="API_KEY" -p 80:80 gamgaroo/esmeralda
  1. Create a Unity Cloud webhook with URL http://{esmeralda-url}/api/builds
  2. Start new build on Unity Cloud
  3. After build completion Unity Cloud will push a notification to Esmeralda
  4. After deployment completion the build will be accessible on http://{esmeralda-url}/index.html

Environment variables

Required

Unity:ApiKey

Optional

Admin:Username (Default: admin)

Admin:Password (Default: admin)

Slack:Enable (Default: false)

Slack:WebhookUrl (Defalt: WEBHOOK_URL)

Unity:CloudUrl (Default: https://build-api.cloud.unity3d.com)

It is highly recommended that you change the default Username and Password values for security reasons.

Example

docker run -e Admin.Username="admin" -e Admin.Password="password" -e Unity:ApiKey="API_KEY" -e Slack:Enable=true -e Slack:WebhookUrl="WEBHOOK_URL" -p 80:80 gamgaroo/esmeralda

Settings API

You can configure Esmeralda using settings API:

You can GET or POST on http://{esmeralda-url}/api/settings

{
    "unity": {
        "apiKey": "API_KEY",
        "cloudUrl": "https://build-api.cloud.unity3d.com"
    },
    "slack": {
        "enable": false,
        "webhookUrl": "WEBHOOK_URL"
    }
}

API is secured with Basic Authentication.

Notifications

You can enable Slack notifications. App notify on Deployment Start, Deployment Success and Deployment Failure.

  1. Create Slack webhook on Slack admin page
  2. Configure Settings/slack.json with your WebhookUrl in Slack section and set Enable to true