== @ensono-stacks/workspace:init-deployment

.Set up deployment infrastructure for existing workspace
[%collapsible]
=====
Set up configuration for deployment & infra for the workspace.

Allows you to choose your recommended 3rd party provider options.

[discrete]
=== Prerequisites

Workspace FE scaffolded using the `@ensono-stack/workspace:init` generator.

[discrete]
=== Usage

Scaffold your NX workspace with deployment config using the following command:

----
nx g @ensono-stacks/workspace:init-deployment
----

[discrete]
=== Command line arguments

Interactive options can instead be passed via the command line:

[cols="1,3,1,2,1"]
|===
|Option |Description |Type |Accepted Values |Default

|--pipelineRunner
|Which pipeline runner to use
|enum
|[taskctl, none]
|taskctl

|===

[discrete]
=== Generator Output

If `--pipelineRunner=taskctl` is passed, the generator will also create a `build` directory:

[source, cs]
----
├── workspace root
│   ├── build
│   ├── ├── azDevOps
│   ├── ├── ├── azuredevops-runner.yaml - Azure Devops pipeline definition. Consumes `stages` and `vars` files in this directory
│   ├── ├── ├── azuredevops-stages.yaml - Azure Devops pipeline stages
│   ├── ├── ├── azuredevops-vars.yaml - Azure Devops variable definitions required by the pipeline
│   ├── ├── taskctl
│   ├── ├── ├── contexts.yaml - Context definitions for taskctl
│   ├── ├── ├── tasks.yaml - Task definitions for taskctl to be consumed by the pipeline
----

`nx.json` is also updated with the pipeline runner entry

[source, json]
----
"@ensono-stacks/workspace": {
    "init": {
        "pipelineRunner": "taskctl"
    }
}
----

This sets up a CI/CD pipeline to provide a smooth collaborative workflow.

Currently supported pipeline tools are https://azure.microsoft.com/en-gb/products/devops/[Azure Devops] and https://github.com/taskctl/taskctl[taskctl].

CAUTION: The `build` files will only be generated if required project values have been collected from the link:/docs/getting_started/setup#option-1-stacks-cli[Ensono Stacks CLI] or through the link:/docs/getting_started/setup#option-2-create-stacks-workspace-generator[@ensono-stacks/create-stacks-workspace] plugin.
=====
