Using SQLDSC in a Repository #
SQLDSC is designed to be used in a GIT repository by multiple users across multiple domains. Consider a sample directory tree. Many of these folders are created by sqldsc init
.
│ .gitignore
│ key.txt
│ README.md
│ sqldsc.exe
│
├───.vscode
│ extensions.json
│ settings.json
│
├───config
│ │ PROD.defaults.hcl
│ │ PROD.targets.hcl
│ │ defaults.hcl
│ │ OFFICE.defaults.hcl
│ │ OFFICE.targets.hcl
│ │
│ ├───nodes
│ │ ├───PROD
│ │ │ USKC-MON01P.hcl
│ │ │
│ │ └───OFFICE
│ │ USKC-DEVTXN01D.hcl
│ │ USKC-DEV03D.hcl
│ │
│ ├───tags
│ │ dev.hcl
│ │ prod.hcl
│ │
│ └───scripts
│ database-mail.sql
│ README.md
│ who_is_active_v11_32.sql
│
├───logs
│ └───2020
│ sqldsc_2020_05_OFFICE_bgraziano.log
│ sqldsc_2020_06_OFFICE_bgraziano.log
│ sqldsc_2020_06_PROD_bgraziano.log
│
└───software
VSCodeUserSetup-x64-1.46.0.exe
wholroyd.HCL-0.0.5.vsix
- This model assumes:
- Two domains (OFFICE and PROD) that can’t talk to each other
- Both can see a central GIT repository
- VSCode is the “GUI” for the application
- The
software
directory is checked in and contains the VSCode and HCL extension installation files. This makes it easy to get started in a new domain that doesn’t have Internet access. SQLDSC.exe
is checked into the respository. This helps make sure everyone is running the same version.- Logs are per user which means no merging should be needed. Finding changes across users is accomplished using Find in File across the repository.
- Per domain settings are isolated as much as possible.
- The
.vscode
directory andextensions.json
are created bysqldsc init
and contain suggested extensions. - We use a README.md file in the root of repository to communicate standards. We also have a
TODO.md
and a few other notes to ourselves.