Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
Signed-off-by: Thorsten Hans <[email protected]>
  • Loading branch information
ThorstenHans committed Nov 1, 2024
1 parent a92e507 commit 408ddd1
Showing 1 changed file with 73 additions and 3 deletions.
76 changes: 73 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,78 @@ You can use the following arguments to customize versions installed as part of t

## The `eject` command

TBD
You can export the default template using the `eject` command. Without specifying additional arguments or flags, the template will be written to `stdout`:

### Template Variables
```bash
spin gh eject
```

Alternatively, you can write it to a file using the `output` (short `o`) and the `overwrite` flags:

```bash
spin gh eject -o ci.yaml --overwrite
```

TBD
### Template Data

The following table lists the data passed to the template as part of the `create-action` command:


| Field | DataType | Description | Sample Value |
|-------|----------|-------------|--------------|
| `ActionName` | `string` | Name of the workflow | `CI` |
| `OperatingSystem` | `string` | Desired Operating System | `ubuntu-latest` |
| `ActionTriggers` | `ActionTriggers` | Desired triggers | See ActionTriggers section below |
| `EnvironmentVariables` | `[]EnvVar` | Slice with environment variables | (See EnvVar section below) |
| `Tools` | `Tools` | Desired tool versions | see Tools section below |
| `SpinPlugins` | `string` | A comma separated list of Spin plugins | `js2wasm,kube` |
| `Rust` | `bool` | Indicates if any Spin App or Component is built with Rust | `true` |
| `Go` | `bool` | Indicates if any Spin App or Component is built with Go | `true` |
| `JavaScript` | `bool` | Indicates if any Spin App or Component is built with JavaScript | `true` |
| `Python` | `bool` | Indicates if any Spin App or Component is built with Python | `true` |
| `SpinApps` | `[]spinAppTemplateData` | Information for every Spin App discovered | See SpinAppTemplateData section below |

#### ActionTriggers

| Field | DataType | Description | Sample Value |
|-------|----------|-------------|--------------|
| `ManualDispatch` | `bool` | Is `workflow_dispatch` enabled | `true` |
| `Cron` | `string` | trigger cron expression | `0 2 * * *` |
| `PullRequest` | `string` | trigger for PRs targeting the specified branch | `main` |
| `Push` | `string` | trigger for every push on the specified branch | `main` |

#### EnvVar

| Field | DataType | Description | Sample Value |
|-------|----------|-------------|--------------|
| `Key` | `string` | Name of the environment variable | `FOO` |
| `Value` | `string` | Name of the environment variable | `bar` |

#### Tools

| Field | DataType | Description | Sample Value |
|-------|----------|-------------|--------------|
| `Rust` | `string` | Desired Rust Version | `1.80.1` |
| `Go` | `string` | Desired Rust Version | `1.23.2` |
| `TinyGo` | `string` | Desired Rust Version | `0.33.0` |
| `Python` | `string` | Desired Rust Version | `3.13.0` |
| `Node` | `string` | Desired Rust Version | `22` |
| `Spin` | `string` | Desired Rust Version | `2.7.0` |

#### SpinAppTemplateData

| Field | DataType | Description | Sample Value |
|-------|----------|-------------|--------------|
| `Name` | `string` | Name of the Spin App | `spin-app-1` |
| `Path` | `string` | Name of the Spin App | `./src/app1` |
| `Setup` | `string` | Per Spin App setup scripts | `python3 -m venv venv && source venv/bin/activate` |
| `Teardown` | `string` | Name of the Spin App | `deactivate` |
| `Components` | `[]componentTemplateData` | Information for every Component of the App | See ComponentTemplateData section below |

#### ComponentTemplateData

| Field | DataType | Description | Sample Value |
|-------|----------|-------------|--------------|
| `Language` | `string` | Name of the Language used for this component (Rust, Go, JavaScript, Python) App | `Rust` |
| `Path` | `string` | Path of the component | `./src/app1/api` |
| `InstallDependenciesCommand` | `string` | Command used to install component dependencies | `npm install` |

0 comments on commit 408ddd1

Please sign in to comment.