> ## Documentation Index
> Fetch the complete documentation index at: https://docs.directgvr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Alias, repository, environment and history files

> Understand the metadata files the deployment scripts write for each repository and how the launcher uses them.

For every repository, the [deployment scripts](https://docs.directgvr.com/release-automation/deployment-scripts.md) write these files to the target folder on your CDN or storage service:

* `alias.json`: key/value pairs for every release you've promoted in the repository.
* `repositoryname.environmentname.json`: the release currently assigned to that environment.
* `repositoryname.json`: every environment with a release in this repository, and the release assigned to each.
* `repositoryname.history.json`: every release deployed to the repository.

You control how launchers use these files, so you can build your own alias files from the information if you need to.

> [!NOTE]
>
> If you deploy with a code-signing certificate, these files are JWT-encoded. Decode them with a tool such as [jwt.io](https://jwt.io/) to read them.

## Alias file

Each entry pairs a name the launcher looks for with a release ID (the SHA1 of the release's files), in the format `repositoryname.environmentname: releaseID`.

```json https://cdn.example.com/game/llamagame/alias.json theme={null}
{
  "llamagame.qa": "3ac5607fb72faae9af1ecf89b5f53b0b02508052",
  "llamagame.production": "2cc958d0b81ca3b946ea50572f883e34d52d51f2"
}
```

## Environment file

Holds the release currently assigned to the environment: its ID, when it was promoted, when it was scanned (deployed) and its version.

```json https://cdn.example.com/game/llamagame/llamagame.stage.json theme={null}
{
  "id": "3ac5607fb72faae9af1ecf89b5f53b0b02508052",
  "promoteTime": 1580844988,
  "scanTime": 1580844562,
  "version": "build1"
}
```

## Repository file

Lists every environment with a release, with the same information as the environment file.

```json https://cdn.example.com/game/llamagame/llamagame.json theme={null}
{
  "environments": {
    "qa": {
      "id": "3ac5607fb72faae9af1ecf89b5f53b0b02508052",
      "promoteTime": 1580844996,
      "scanTime": 1580844562,
      "version": "build1"
    },
    "production": {
      "id": "2cc958d0b81ca3b946ea50572f883e34d52d51f2",
      "promoteTime": 1580845019,
      "scanTime": 1580844687,
      "version": "build2"
    }
  }
}
```

## Repository history file

`promote.py` creates and updates the files above. The history file is updated after each deployment instead.

```json https://cdn.example.com/game/llamagame/llamagame.history.json theme={null}
{
  "history": [
    {
      "id": "3ac5607fb72faae9af1ecf89b5f53b0b02508052",
      "scanTime": 1588291353,
      "version": "build1",
      "description": null
    },
    {
      "id": "2cc958d0b81ca3b946ea50572f883e34d52d51f2",
      "scanTime": 1588291509,
      "version": "build2",
      "description": null
    }
  ]
}
```

## How the launcher uses the alias file

The launcher looks up the release for its name in the alias file. The sample skins use `alias.json` by default. In the workflow, macros build the name and the URL:

```json theme={null}
"loadMacros": {
  "type": "macro",
  "keyValuePairs": {
    "repository": "mygame-{systemShortName}",
    "repositoryTitle": "My Game",
    "environment": "production",
    "alias_url": "https://cdn.example.com/game/",
    "installDirectory": "{moduleDirectory}Download{pathSlash}",
    "repositoryName": "{repository}.{environment}",
    "repositoryMetafile": "{repositoryName}.metafile",
    "repositoryAliasUrl": "{alias_url}{repository}/alias.json",
    "repositoryCatalogUrl": "{alias_url}{repository}/catalog/"
  }
},
```

On Windows, the launcher looks for the release ID of `mygame-win.production` in `https://cdn.example.com/game/mygame-win/alias.json`.

## Related

* [Create environments and promote releases](https://docs.directgvr.com/release-automation/environments-and-promotion.md)
* [Options for securing metadata](https://docs.directgvr.com/release-automation/securing-metadata.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.