Skip to content

Commit

Permalink
document variables & template overview
Browse files Browse the repository at this point in the history
  • Loading branch information
eoinmcafee00 committed Jun 9, 2021
1 parent d9904ce commit 66c027b
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
public
public/**
resources
.DS_Store
10 changes: 10 additions & 0 deletions content/template/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ aliases:
- /user-guide/templates
---

# _Why use templates?_

Organizations are having difficulty maintaining large amounts of configuration files, especially when those configuration files are very similar across projects. A pain point is needing to change a docker image (for example) and having to update configuration files in hundreds of repositories.
Configuration templates that can be shared across projects.

This will simplify configuration management at organizations that have
large numbers of similar configuration files; it will reduce complexity
of yaml files in individual repositories and will simplify management of
configuration across repositories.

Here are the articles in this section:

{{< cards >}}
89 changes: 89 additions & 0 deletions content/template/variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
date: 2000-01-01T00:00:00+00:00
title: Variables
author: eoinmcafee
weight: 20
disable_toc: true
aliases:
- /configure/templates/variables/
description: a list and description of variables available for use
---
The following variables are available for use for both starlark & Jsonnet templates:

# Build

Jsonnet example usage:
```
local event = std.extVar("build.event");
local action = std.extVar("build.action");
please note they must be prefixed with 'build.'
```

Starlark example usage:
```
{
"event": ctx.build.event,
"action": ctx.build.action
}
please note they must be prefixed with 'build.'
```

Variable | Description
------------|------------
event |
action |
environment |
link |
branch |
source |
before |
after |
target |
ref |
commit |
title |
message |
source_repo |
author_login |
author_email |
author_avatar |
sender |

# Repo

Jsonnet example usage:
```
local uid = std.extVar("repo.uid");
local name = std.extVar("repo.name");
please note they must be prefixed with 'repo.'
```

Starlark example usage:
```
{
"uid": ctx.repo.uid,
"name": ctx.repo.name
}
please note they must be prefixed with 'repo.'
```

Variable | Description
------------|------------
uid |
name |
namespace |
slug |
git_http_url |
git_ssh_url |
link |
branch |
config |
private |
visibility |
active |
trusted |
protected |
ignore_forks |
ignore_pull_requests |

0 comments on commit 66c027b

Please sign in to comment.