Skip to content

Commit 67ff20b

Browse files
author
Nicholas M. Iodice
authored
pointing referenced variable groups to the latest documentation (#378)
1 parent 192496c commit 67ff20b

File tree

2 files changed

+8
-109
lines changed

2 files changed

+8
-109
lines changed

docs/GETTING_STARTED_ADD_PAT_OWNER.md

Lines changed: 4 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export AGENT_POOL_NAME=""
4242
The following values are used like constants and should not need to change (unless the build pipeline definition is modified).
4343

4444
```bash
45-
export COBALT_VAR_GROUP_INFRA="Infrastructure Pipeline Variables"
46-
export COBALT_VAR_GROUP_ENV_SUFFIX="Environment Variables"
4745
export COBALT_PIPELINE_NAME="Cobalt CICD Pipeline"
4846
```
4947

@@ -122,7 +120,7 @@ az repos import create --git-url $COBALT_SOURCE_URL --repository "$TEMPLATE_DEVO
122120
```yaml
123121
configurationMatrix:
124122
- jobName: az_service_single_region
125-
terraformTemplatePath: 'infra/templates/az-service-single-region'
123+
terraformTemplatePath: 'infra/templates/az-service-single-region' # NOTE: this can be configured as an environment variable if needed!
126124
terraformWorkspacePrefix: 'sr'
127125
environmentsToTeardownAfterRelease:
128126
- 'devint'
@@ -229,86 +227,14 @@ az devops service-endpoint azurerm create --azure-rm-subscription-id $SUBSCRIPTI
229227

230228
* Toggle Multi-stage pipelines
231229

232-
* Configure *Infrastructure Pipeline Variables* as the first of two variable groups
233-
* Select Pipelines tab from within side-navigation menu then select Library tab
234-
* Click [+Variable group] and name it "Infrastructure Pipeline Variables"
235-
* Add the following variables:
236-
237-
| Name | Value | Var Description |
238-
|-------------|-----------|-----------|
239-
| `AGENT_POOL` | Hosted Ubuntu 1604 | The type of build agent used for your deployment. |
240-
| `ARM_PROVIDER_STRICT` | false | Terraform ARM provider modification |
241-
| `BUILD_ARTIFACT_NAME` | drop | Name to identity the folder containing artifacts output by a build. |
242-
| `GO_VERSION`| 1.12.5 | The version of Go terraform deployments are bound to. |
243-
| `PIPELINE_ROOT_DIR` | devops/providers/azure-devops/templates/ | A path for finding Cobalt templates. |
244-
| `REMOTE_STATE_CONTAINER` | `<CONTAINER_NAME>`| The remote blob storage container name for managing the state of a Cobalt Template's deployed infrastructure. Also is used as a naming convention for partitioning state into multiple workspaces. This name was created in an earlier step from within the azure portal. |
245-
| `SCRIPTS_DIR` | infrastructure/scripts | Path to scripts used at runtime for composing build and release jobs at various pipeline stages. |
246-
| `TEST_HARNESS_DIR` | test-harness/ | A path to the cobalt test harness for running integration and unit tests written in Docker and Golang. |
247-
| `TF_ROOT_DIR`| infra | The primary path for all Cobalt templates and the modules they are composed of. |
248-
| `TF_VERSION`| 0.12.4 | The version of terraform deployments are bound to. |
249-
| `TF_WARN_OUTPUT_ERRORS`| 1 | The severity level of errors to report. |
250-
251-
> Important: Every targeted environment specified within the build pipeline expects a
252-
> variable group specified with the naming convention `<ENVIRONMENT_NAME> Environment Variables`
230+
* Configure the variables needed by the pipeline. The latest configuration values are described in the [pipeline documentation](../devops/providers/azure-devops/README.md)
253231

254-
> The following CLI command(s) can be run as an alternative to using the portal-based instructions:
255-
256-
```bash
257-
# IMPORTANT: Replace these values as necessary to fit your environment.
258-
az pipelines variable-group create --authorize true --name "$COBALT_VAR_GROUP_INFRA" --variables \
259-
AGENT_POOL="$AGENT_POOL_NAME" \
260-
ARM_PROVIDER_STRICT=true \
261-
BUILD_ARTIFACT_NAME='drop' \
262-
BUILD_ARTIFACT_PATH_ALIAS='artifact' \
263-
GO_VERSION='1.12.5' \
264-
PIPELINE_ROOT_DIR='devops/providers/azure-devops/templates/infrastructure' \
265-
REMOTE_STATE_CONTAINER='BACKENDSTATECONTAINERNAME' \
266-
SCRIPTS_DIR='scripts' \
267-
TEST_HARNESS_DIR='test-harness/' \
268-
TF_DEPLOYMENT_TEMPLATE_ROOT='infra/templates/$TEMPLATE_DEVOPS_INFRA_REPO_NAME' \
269-
TF_DEPLOYMENT_WORKSPACE_PREFIX='PROJECTDEPLOYMENTWORKSPACEPREFIX' \
270-
TF_ROOT_DIR='infra' \
271-
TF_VERSION='0.12.4' \
272-
TF_WARN_OUTPUT_ERRORS=1
273-
```
274-
275-
* Configure *DevInt Environment Variables* as the final variable group
276-
* Environment-specific variables have no default values and must be assigned
277-
* Return to the Library tab
278-
* Click [+Variable group] and name it *DevInt Environment Variables*
279-
* Add the following variables:
280-
281-
| Name | Value | Var Description |
282-
|-------------|-----------|-----------|
283-
| `ARM_SUBSCRIPTION_ID` | `<ARM_SUBSCRIPTION_ID>` | The Azure subscription ID for which all resources will be deployed. Refer to the Azure subscription chosen in Azure portal for Cobalt deployments. |
284-
| `REMOTE_STATE_ACCOUNT` | `<AZURE_STORAGE_ACCOUNT_NAME>` | The storage container account name created in a previous step that is used to manage the state of this deployment pipeline. The storage Account is shared among all non-prod deployment stages. |
285-
| `SERVICE_CONNECTION_NAME` | ex. Cobalt Deployment Administrator-`<TenantName>` | The custom name of the service connection configured in a previous Azure Devops step that establishes a connection between the Service Principal and the Azure subscription that it's permissioned for. |
286-
| `TF_CLI_ARGS` | "-refresh=false" | specify additional arguments to the command-line. This allows easier automation in CI environments as well as modifying default behavior of Terraform |
287-
288-
> The following CLI command(s) can be run as an alternative to using the portal-based instructions:
232+
> **Note**: The following CLI command can be run as an alternative to using the portal-based instructions:
289233
290234
```bash
291-
# IMPORTANT: Replace these values as necessary to fit your environment.
292-
DEVINT_VAR_GROUP="DevInt $COBALT_VAR_GROUP_ENV_SUFFIX"
293-
az pipelines variable-group create --authorize true --name "$DEVINT_VAR_GROUP" --variables \
294-
ARM_SUBSCRIPTION_ID='TARGETSUBSCRIPTIONID' \
295-
REMOTE_STATE_ACCOUNT='BACKENDSTATESTORAGEACCOUNTNAME' \
296-
SERVICE_CONNECTION_NAME='SERVICECONNECTIONNAME' \
297-
TF_CLI_ARGS='-refresh=false'
235+
az pipelines variable-group create --authorize true --name "$VARIABLE_GROUP_NAME" --variables KEY1="VALUE1" ...
298236
```
299237

300-
* Additional Setup Instructions per Template
301-
302-
Select Cobalt templates require additional pipeline setup. Please complete extended steps if chosen template resides in the below list.
303-
304-
* az-isolated-service-single-region
305-
1. Create ASE w/ VNET
306-
2. Add additional env vars to *Infrastructure Pipeline Variables* group
307-
308-
| Name | Value | Var Description |
309-
|-------|-------|-----------------|
310-
| `TF_DEPLOYMENT_TEMPLATE_ROOT` | infra/templates/az-isolated-service-single-region | Pipeline reference for relative location of this template |
311-
312238
* Link Variable Groups for DevInt and Infrastructure to the Build Pipeline
313239
* Select Pipelines tab from within side-navigation menu
314240
* Select existing pipeline and then click [Edit]

docs/GETTING_STARTED_APP_DEV_CLI.md

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ export GIT_SOURCE_URL=""
4444

4545
The following values are used like constants and should not need to change (unless the build pipeline definition is modified).
4646
```bash
47-
export COBALT_VAR_GROUP_INFRA="Infrastructure Pipeline Variables"
48-
export COBALT_VAR_GROUP_ENV_SUFFIX="Environment Variables"
4947
export COBALT_PIPELINE_NAME="Cobalt CICD Pipeline"
5048
```
5149

@@ -112,42 +110,17 @@ Create the build pipeline. We are intentionally skipping the initial run since w
112110
az pipelines create --name "$COBALT_PIPELINE_NAME" --repository "$APP_DEVOPS_INFRA_REPO_NAME" --branch master --repository-type tfsgit --yml-path $APP_DEVOPS_INFRA_YML_PATH --skip-run true
113111
```
114112
115-
Variable groups are utilized by the pipeline to configure how the Cobalt template will be tested and deployed. The `az pipelines variable-group create` `--variables` flag expects a list of space-delimited key value pairs (e.g., `KEY1='val1' KEY2=true`).
113+
Variable groups are utilized by the pipeline to configure how the Cobalt template will be tested and deployed. The latest configuration values are described in the [pipeline documentation](../devops/providers/azure-devops/README.md) and they will need to be configured in order for the CICD pipeline to effectively run.
116114

117-
The following *Infrastructure Pipeline Variables* are used by all possible environment-specific executions for the Cobalt pipelines.
115+
> **Note**: The following CLI command can be run as an alternative to using the portal-based instructions:
118116
119117
```bash
120-
# IMPORTANT: Replace these values as necessary to fit your environment.
121-
az pipelines variable-group create --authorize true --name "$COBALT_VAR_GROUP_INFRA" --variables \
122-
AGENT_POOL='Hosted Ubuntu 1604' \
123-
ARM_PROVIDER_STRICT=true \
124-
BUILD_ARTIFACT_NAME='drop' \
125-
BUILD_ARTIFACT_PATH_ALIAS='artifact' \
126-
GO_VERSION='1.12.5' \
127-
PIPELINE_ROOT_DIR='devops/providers/azure-devops/templates/infrastructure' \
128-
REMOTE_STATE_CONTAINER='BACKENDSTATECONTAINERNAME' \
129-
SCRIPTS_DIR='scripts' \
130-
TEST_HARNESS_DIR='test-harness/' \
131-
TF_DEPLOYMENT_TEMPLATE_ROOT='infra/templates/az-hello-world' \
132-
TF_DEPLOYMENT_WORKSPACE_PREFIX='PROJECTDEPLOYMENTWORKSPACEPREFIX' \
133-
TF_ROOT_DIR='infra' \
134-
TF_VERSION='0.12.4' \
135-
TF_WARN_OUTPUT_ERRORS=1
118+
az pipelines variable-group create --authorize true --name "$VARIABLE_GROUP_NAME" --variables KEY1="VALUE1" ...
136119
```
137-
> NOTE: The TF_DEPLOYMENT_TEMPLATE_ROOT and TF_DEPLOYMENT_WORKSPACE_PREFIX values are not used by all templates. If targeting the Isolated Service Single Region template, you will want to set these values; however, they will not have an effect on the Hello World template.
138120

139121
Within the pipeline build definition you may specify the number of environments that will be targed for deployment. For each environment specified, you will need a variable group that defines the Azure Subscription ID to where the infrastructure will be provisioned. You will also need to set a Service Connection that has permissions to provision resources on that subscription.
140122

141-
For this walkthrough, we will only create a single environment -- *devint*. The following commands will create the required *DevInt Environment Variables* variable group.
142-
```bash
143-
# IMPORTANT: Replace these values as necessary to fit your environment.
144-
DEVINT_VAR_GROUP="DevInt $COBALT_VAR_GROUP_ENV_SUFFIX"
145-
az pipelines variable-group create --authorize true --name $DEVINT_VAR_GROUP --variables \
146-
ARM_SUBSCRIPTION_ID='TARGETSUBSCRIPTIONID' \
147-
REMOTE_STATE_ACCOUNT='BACKENDSTATESTORAGEACCOUNTNAME' \
148-
SERVICE_CONNECTION_NAME='SERVICECONNECTIONNAME' \
149-
TF_CLI_ARGS=''
150-
```
123+
For this walkthrough, we will only create a single environment -- *devint*. Follow the documentation linked above and create the necessary variable groups for devint.
151124

152125
> NOTE: The Service Connection name should be provided by someone in your organziation with the *Global administrator* permission for your Azure Active Directory tenant. If it has not been provisisioned for you, you may create another by following the directions outlined in the [Getting Started - Advocated Pattern Onwer documentation](./GETTING_STARTED_ADD_PAT_OWNER.md)
153126

0 commit comments

Comments
 (0)