Siteminder DX deploy
Instructions
- dx command is available in the global node_modules folder, add it to the path before executing dx-deploy.js.
- if user dosn't have dx installed in global, use
npx @siteminder/dx to execute the command instead of dx.
- before executing, please add all user bash environment variables to the command.
- When asking for arguments, provide the user the ability to select from a dropdown or if requires typing allow the user to address each argument independantly
- required arguments: system, environment, component, workspace
environment can be typically platform-dev tpi shared prod, but can be something else
workspace is the folder that contains all cloned repositories, each repository is a system, the folder name is usually also the system name but not always
- Ask user to provide the workspace, and remember it for future use.
- optional arguments: region, build version, realm, config branch, infrastructure branch
region can be as of right now only apac or emea
realm can either be dev pciprod or preprod. This can be determined through the environment selected
- if environment is
platform-dev or shared realm will be dev
- if environment is
prod, realm will be pciprod
- if environment is
tpi or demo realm will be preprod
- always asking user to provide config-branch and infrastructure-branch, if not provided, then use default values, options while asking is: master or provided your branch name.
- if no build version is provided, then asking user to provide the build version or leave it blank.
- before executing, change executing directory to the workspace that user has provided.
- before executing, give an outline of what is about to proceed and ask user to approve with all relevant details shown.
- command for executing the script:
- componentTerraformConfigPath is the path to the terraform config file for the component.
- If region IS NOT provided this will be /-config-///terraform.tfvars
- If region IS provided this will be /-config-///terraform.tfvars
- check is existing under -config-, if not, try find -inf or -app, if not found, error out.
- configBranch is the branch to checkout in the config repo, if it exists. default: master
- infrastructureBranch is the branch to checkout in the app infrastructure repo, if it exists. default: master
- buildVersion is the build version to deploy.
- if no build version is provided, then don't have to provide the argument in the command.
dx infrastructure deploy -C <componentTerraformConfigPath> -b <configBranch> -i <infrastructureBranch> -V <buildVersion>
- if any optional arguments are not provided, then don't have to provide the argument in the command.
- present all stdout and stderr output to the user.
- then wait for user to approve for further actions.
Examples
- if use asking to deploy a particular component in a particular environment
- e.g: "deploy google-gha provider-api to platform-dev"
- this means:
system -> google-gha
component -> provider-api
environment -> platform-dev
- then the command should be:
dx infrastructure deploy -C google-gha-config-dev/provider-api/platform-dev/terraform.tfvars -b master -i master
- if user asking to deploy a particular component in a particular environment and region
- e.g: "deploy tbb-google pricing-bridge to platform-dev apac"
- this means:
system -> tbb-google
component -> pricing-bridge
environment -> platform-dev
region -> apac
- then the command should be:
dx infrastructure deploy -C tbb-google-config-dev/pricing-bridge/platform-dev/apac/terraform.tfvars -b master -i master
Examples
Example for user asking to deploy a particular component in a particular environment
- user request: "deploy tbb-google pricing-bridge apac to platform-dev"
- this means:
system -> tbb-google
component -> pricing-bridge
region -> apac
environment -> platform-dev
- should change to the workspace directory before executing the command.
- then the command should be:
dx infrastructure deploy -C tbb-google-config-dev/pricing-bridge/platform-dev/apac/terraform.tfvars -b master -i master
Example for user asking to deploy a particular component in a particular environment and region
- user request: "deploy tbb-google content-handler to platform-dev"
- this means:
system -> tbb-google
component -> content-handler
environment -> platform-dev
- should change to the workspace directory before executing the command.
- then the command should be:
dx infrastructure deploy -C tbb-google-config-dev/content-handler/platform-dev/terraform.tfvars -b master -i master
Example for user who dosn't have dx installed in global
- user request: "deploy tbb-google pricing-bridge apac to platform-dev"
- this means:
system -> tbb-google
component -> pricing-bridge
region -> apac
environment -> platform-dev
- then the command should be:
npx @siteminder/dx infrastructure deploy -C tbb-google-config-dev/pricing-bridge/platform-dev/apac/terraform.tfvars -b master -i master
1---2name: dx-deploy3description: use to deploy a siteminder component using the dx command4---5
6# Siteminder DX deploy
7
8## Instructions
9- dx command is available in the global node_modules folder, add it to the path before executing dx-deploy.js.
10- if user dosn't have dx installed in global, use `npx @siteminder/dx` to execute the command instead of `dx`.
11- before executing, please add all user bash environment variables to the command.
12- When asking for arguments, provide the user the ability to select from a dropdown or if requires typing allow the user to address each argument independantly
13- required arguments: system, environment, component, workspace
14 - `environment` can be typically `platform-dev` `tpi` `shared` `prod`, but can be something else
15 - `workspace` is the folder that contains all cloned repositories, each repository is a `system`, the folder name is usually also the system name but not always
16- Ask user to provide the workspace, and remember it for future use.
17- optional arguments: region, build version, realm, config branch, infrastructure branch
18 - `region` can be as of right now only `apac` or `emea`
19 - `realm` can either be `dev` `pciprod` or `preprod`. This can be determined through the `environment` selected
20 - if environment is `platform-dev` or `shared` realm will be `dev`
21 - if environment is `prod`, realm will be `pciprod`
22 - if environment is `tpi` or `demo` realm will be `preprod`
23- always asking user to provide config-branch and infrastructure-branch, if not provided, then use default values, options while asking is: master or provided your branch name.
24- if no build version is provided, then asking user to provide the build version or leave it blank.
25- before executing, change executing directory to the workspace that user has provided.
26- before executing, give an outline of what is about to proceed and ask user to approve with all relevant details shown.
27- command for executing the script:
28- componentTerraformConfigPath is the path to the terraform config file for the component.
29 - If region IS NOT provided this will be <workspace>/<system>-config-<realm>/<component>/<environment>/terraform.tfvars
30 - If region IS provided this will be <workspace>/<system>-config-<realm>/<component>/<environment>/<region>terraform.tfvars
31 - check <component> is existing under <system>-config-<realm>, if not, try find <component>-inf or <component>-app, if not found, error out.
32- configBranch is the branch to checkout in the config repo, if it exists. default: master
33- infrastructureBranch is the branch to checkout in the app infrastructure repo, if it exists. default: master
34- buildVersion is the build version to deploy.
35 - if no build version is provided, then don't have to provide the argument in the command.
36```bash
37dx infrastructure deploy -C <componentTerraformConfigPath> -b <configBranch> -i <infrastructureBranch> -V <buildVersion>
38```
39- if any optional arguments are not provided, then don't have to provide the argument in the command.
40- present all stdout and stderr output to the user.
41- then wait for user to approve for further actions.
42
43## Examples
44- if use asking to deploy a particular component in a particular environment
45- e.g: "deploy google-gha provider-api to platform-dev"
46- this means:
47 - `system` -> google-gha
48 - `component` -> provider-api
49 - `environment` -> platform-dev
50- then the command should be:
51```bash
52dx infrastructure deploy -C google-gha-config-dev/provider-api/platform-dev/terraform.tfvars -b master -i master
53```
54
55- if user asking to deploy a particular component in a particular environment and region
56- e.g: "deploy tbb-google pricing-bridge to platform-dev apac"
57- this means:
58 - `system` -> tbb-google
59 - `component` -> pricing-bridge
60 - `environment` -> platform-dev
61 - `region` -> apac
62- then the command should be:
63```bash
64dx infrastructure deploy -C tbb-google-config-dev/pricing-bridge/platform-dev/apac/terraform.tfvars -b master -i master
65```
66
67## Examples
68
69#### Example for user asking to deploy a particular component in a particular environment
70- user request: "deploy tbb-google pricing-bridge apac to platform-dev"
71- this means:
72 - `system` -> tbb-google
73 - `component` -> pricing-bridge
74 - `region` -> apac
75 - `environment` -> platform-dev
76- should change to the workspace directory before executing the command.
77- then the command should be:
78```bash
79dx infrastructure deploy -C tbb-google-config-dev/pricing-bridge/platform-dev/apac/terraform.tfvars -b master -i master
80```
81
82#### Example for user asking to deploy a particular component in a particular environment and region
83- user request: "deploy tbb-google content-handler to platform-dev"
84- this means:
85 - `system` -> tbb-google
86 - `component` -> content-handler
87 - `environment` -> platform-dev
88- should change to the workspace directory before executing the command.
89- then the command should be:
90```bash
91dx infrastructure deploy -C tbb-google-config-dev/content-handler/platform-dev/terraform.tfvars -b master -i master
92```
93
94#### Example for user who dosn't have dx installed in global
95- user request: "deploy tbb-google pricing-bridge apac to platform-dev"
96- this means:
97 - `system` -> tbb-google
98 - `component` -> pricing-bridge
99 - `region` -> apac
100 - `environment` -> platform-dev
101- then the command should be:
102```bash
103npx @siteminder/dx infrastructure deploy -C tbb-google-config-dev/pricing-bridge/platform-dev/apac/terraform.tfvars -b master -i master
104```