Complete Setup of This Repository
Setup This Design Pattern in a New Repository
These instructions assume GitLab Flow for change managing environment promotion using GitOps methodologies.
1. Copy This Repository to Your Own Location
This can be done on a group on GitLab.com or on a self-hosted instance.
-
-
Create a GitLab Group called "Project Top Scope" (this will be your "top scope" group)
-
-
-
Create a subgroup under the original group called "Project Sub Scope" (this will be your subscope group)
-
-
-
In the original repository, on the left navigation bar, click Project overview => Details
-
-
-
From the upper right of the page click Clone (Dropdown button)
-
-
-
From the Clone with HTTPS field, click the Copy Icon to copy the https:// repo url.
-
-
-
While in the subgroup you created earlier, click the "+" icon at the top of the screen and select "New Project"
-
-
-
From the "New Project" page, click Import project (tab)
-
-
-
Click Repo by URL
-
Note: if this option is missing it may be disabled in your instance, consult your GitLab instance administrator.
-
-
In Git repository URL paste the copied URL. (Note: it must be https://)
-
-
-
Set the following fields to your preferences: Project name, Project URL, Project slug, Visibility Level
-
-
-
Click Create project
-
-
-
In the new repository you made from this copy, restart this checklist as a GitLab issue so that: you can track your a) individual progress with b) an interactive checklist where you can checkoff each step, by:
-
2. Customize the Repository Settings
Please note that when "State = Protected" it is NOT write protecting the variable. Instead, this is a switch the governs whether the specific variable is passed into "Protected Environments" or not. Read more.
In the "Project Top Scope"
-
-
Update the group environment variables by clicking Settings => CI/CD => Variables and adding the below.
-
Type | Key | Value |
Protected State |
Masked | Scope |
---|---|---|---|---|---|
Variable | TOP_SCOPE_VAR1 | SET AT TOP SCOPE | Off | Off | N/A |
Variable | TOP_SCOPE_VAR2 | SET AT TOP SCOPE | Off | On | N/A |
Variable | TOP_SCOPE_VAR3 | SET AT TOP SCOPE | Off | On | N/A |
In the "Project Sub Scope"
-
-
Update the group environment variables by clicking Settings => CI/CD => Variables and adding the below.
-
Type | Key | Value |
Protected State |
Masked | Scope |
---|---|---|---|---|---|
Variable | SUBSCOPE_VAR1 | SET AT SUBGROUP SCOPE | Off | Off | N/A |
Variable | SUBSCOPE_VAR2 | SET AT SUBGROUP SCOPE | Off | On | N/A |
Variable | TOP_SCOPE_VAR1 | OVERRIDDEN AT SUBSCOPE | Off | On | N/A |
In the fresh repository copy:
-
-
Update the project environment variables by clicking Settings => CI/CD => Variables and adding the below. You must create the scopes by typing them in "search" and clicking "create" (which appears AFTER you type in a non-matching value).
-
Important: The character case must exactly match your branch names (done as all lower throughout this example).
Type | Key | Value |
Protected State |
Masked | Scope |
---|---|---|---|---|---|
Variable | GLOBAL_VISIBLE_VAR | VisibleData | Off | Off | All environments |
Variable | MULTI_ENV_VAR | Set In Envs That Start with S | Off | Off | s* |
Variable | PWD1 | ProdPswd | Off | On | production |
Variable | PWD1 | SandboxPswd | Off | On | sandbox |
Variable | PWD1 | StagePswd | Off | On | stage |
Variable | REPO_SCOPE_VAR1 | Set at REPO Scope | Off | On | All environments |
Variable | SUBSCOPE_VAR2 | OVERRIDDEN AT REPO SCOPE | Off | On | All environments |
Variable | TOP_SCOPE_VAR2 | OVERRIDDEN AT SUBSCOPE AND AGAIN AT REPO SCOPE | Off | On | All environments |
Variable | TOP_SCOPE_VAR3 | OVERRIDDEN AT REPO SCOPE | Off | On | All environments |
Variable | VISIBLE_ENV_DATA | ProdVisible | Off | Off | production |
Variable | VISIBLE_ENV_DATA | SandboxVisible | Off | Off | sandbox |
Variable | VISIBLE_ENV_DATA | StageVisible | Off | Off | stage |
-
-
From the left navigation, click Repository => Branches
-
-
-
There should be at least the branches listed in the table below. If any are missing, from the upper right, click New branch (button) and create any that are missing (must be lower case names).
Branch Allowed to merge Allowed to push Code owner approval master [default] Developers + Maintainers Developers + Maintainers Off production Maintainers ***** No one Off sandbox Developers + Maintainers No one Off Stage Developers + Maintainers No one Off * Can be set to a custom GitLab group in Premium and above.
-
-
-
In Settings => Repository => Protected Branches => Set Branch Protections according to the table in the previous step:
-
-
-
In Settings => General => Merge Requests => UNCHECK: Enable 'Delete source branch' option by default
-
-
-
In Settings => General => Merge Requests => CHECK: Pipelines must succeed
-
-
-
In Settings => General => Merge Requests => CHECK: All discussions must be resolved
-
-
-
In Settings => Repository => Default Branch => SELECT: 'Master'
-
3 Create Personal Exploration Checklists
Guided explorations are implemented as GitLab issue templates so they can be used to create a personal progress tracking checklist for anyone wishing to walk through the exploration.
When in an issue, the checklist steps become clickable (without changing to markdown edit mode) and can be used to track personal progress by many individuals.
-
-
On the left navigation of this repository click Issues
-
-
-
Click New issue
-
-
-
On the New Issue page, next to Title, click Choose a template and select one of the templates containing the text Guided-Exploration
-
-
-
The new issue created allows you to check items off as you complete them.
-