Skip to content

Commit 827e045

Browse files
start
1 parent 0335a82 commit 827e045

File tree

9 files changed

+584
-0
lines changed

9 files changed

+584
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vendor
2+
jsonnetfile.lock.json

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
generate:
2+
jsonnet -m gen -S -J vendor main.libsonnet | xargs -n 1 -- jsonnetfmt --no-use-implicit-plus -i
3+

docs/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# example
2+
3+
Jsonnet library for example
4+
## Install
5+
6+
```
7+
jb install github.com/example/example@master
8+
```
9+
10+
## Usage
11+
12+
```jsonnet
13+
local example = import "github.com/example/example/main.libsonnet"
14+
```
15+

gen/normalJob.libsonnet

Lines changed: 142 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
'#withConcurrency': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: 'Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.' } },
3+
withConcurrency(value): { concurrency: value },
4+
'#withConcurrencyMixin': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: 'Concurrency ensures that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can use any context except for the secrets context. \nYou can also specify concurrency at the workflow level. \nWhen a concurrent job or workflow is queued, if another job or workflow using the same concurrency group in the repository is in progress, the queued job or workflow will be pending. Any previously pending job or workflow in the concurrency group will be canceled. To also cancel any currently running job or workflow in the same concurrency group, specify cancel-in-progress: true.' } },
5+
withConcurrencyMixin(value): { concurrency+: value },
6+
concurrency+:
7+
{
8+
'#withConcurrency': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: '' } },
9+
withConcurrency(value): { concurrency: value },
10+
},
11+
'#withIf': { 'function': { args: [{ default: null, enums: null, name: 'value', type: ['boolean', 'number', 'string'] }], help: 'You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.' } },
12+
withIf(value): { 'if': value },
13+
'#withName': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: 'The name of the job displayed on GitHub.' } },
14+
withName(value): { name: value },
15+
'#withNeeds': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: '' } },
16+
withNeeds(value): { needs: value },
17+
'#withPermissions': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: '' } },
18+
withPermissions(value): { permissions: value },
19+
'#withSecrets': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: "When a job is used to call a reusable workflow, you can use 'secrets' to provide a map of secrets that are passed to the called workflow. Any secrets that you pass must match the names defined in the called workflow." } },
20+
withSecrets(value): { secrets: value },
21+
'#withSecretsMixin': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: "When a job is used to call a reusable workflow, you can use 'secrets' to provide a map of secrets that are passed to the called workflow. Any secrets that you pass must match the names defined in the called workflow." } },
22+
withSecretsMixin(value): { secrets+: value },
23+
secrets+:
24+
{
25+
'#withEnv': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: '' } },
26+
withEnv(value): { secrets+: { env: value } },
27+
},
28+
'#withStrategy': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'object' }], help: 'A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in.' } },
29+
withStrategy(value): { strategy: value },
30+
'#withStrategyMixin': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'object' }], help: 'A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in.' } },
31+
withStrategyMixin(value): { strategy+: value },
32+
strategy+:
33+
{
34+
'#withFailFast': { 'function': { args: [{ default: true, enums: null, name: 'value', type: 'boolean' }], help: 'When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true' } },
35+
withFailFast(value=true): { strategy+: { 'fail-fast': value } },
36+
'#withMatrix': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: '' } },
37+
withMatrix(value): { strategy+: { matrix: value } },
38+
'#withMaxParallel': { 'function': { args: [{ default: null, enums: null, name: 'value', type: ['number', 'string'] }], help: 'The maximum number of jobs that can run simultaneously when using a matrix job strategy. By default, GitHub will maximize the number of jobs run in parallel depending on the available runners on GitHub-hosted virtual machines.' } },
39+
withMaxParallel(value): { strategy+: { 'max-parallel': value } },
40+
},
41+
'#withUses': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: "The location and version of a reusable workflow file to run as a job, of the form './{path/to}/{localfile}.yml' or '{owner}/{repo}/{path}/{filename}@{ref}'. {ref} can be a SHA, a release tag, or a branch name. Using the commit SHA is the safest for stability and security." } },
42+
withUses(value): { uses: value },
43+
'#withWith': { 'function': { args: [{ default: null, enums: null, name: 'value', type: 'string' }], help: '' } },
44+
withWith(value): { with: value },
45+
}

0 commit comments

Comments
 (0)