Catesta - GitLab Integration¶
Synopsis¶
Scaffolds a new PowerShell module or vault project intended for CI/CD workflow using GitLab .
Getting Started¶
Note: It is important to have a clear understanding of what your project should support before starting with Catesta. If your goal is to create a cross-platform solution or test multiple versions of PowerShell, consider running multiple build types to ensure proper functioning on various platforms and environments.
MacOS support for GitLab is currently is in premium beta.
GitLab Supported Builds:
- You will need an GitLab account.
- Create a new project:
- Create a blank project:
- Authenticate to your repository source as needed
- Create your project using Catesta and select
[L] GitLab
at the CICD prompt. (Catesta Basics) - Write the logic for your module (the hardest part)
- All build testing can be done locally by navigating to
src
and runningInvoke-Build
- By default, this runs all tasks in the build file.
- If you want to run a specific task from the build file you can provide the task name. For example, to just execute Pester tests for your project:
Invoke-Build -Task Test
- If you want to run a specific task from the build file you can provide the task name. For example, to just execute Pester tests for your project:
- By default, this runs all tasks in the build file.
- If using VSCode as your primary editor you can use VSCode tasks to perform various local actions
- Open the VSCode Command palette
- Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux) or F1
- Type
Tasks: Run Task
- Select the task to run
- Examples:
task .
- Runs complete build (all tasks)task Test
- Invokes all Pester Unit Teststask Analyze
- Invokes Script Analyzer checkstask DevCC
- Generates generate xml file to graphically display code coverage in VSCode using Coverage Gutters
- Examples:
- Open the VSCode Command palette
- All build testing can be done locally by navigating to
- Add any module dependencies to your CI/CD bootstrap file:
actions_bootstrap.ps1
- Upload to your GitLab repository which now has a triggered/monitored build action.
- Evaluate results of your build and display your GitLab CI pipeline status badge proudly!
Test Reports¶
Catesta automatically configures your GitLab PowerShell project to generate detailed Tests reports:
Code Coverage reports are not currently possible as GitLab expects Cobertura format which Pester does not currently support.
Notes¶
Additional Reading:
- GitLab CI/CD
- The .gitlab-ci.yml file
- .gitlab-ci.yml keyword reference
- SaaS runners on Windows
- Unit test reports