Installs a Client Credentials-enabled Connected App and a Lightning App that walks you through setting up a connection to a GitLab instance and create a CI/CD file variable that contains authentication information for the org the package is installed in. The variable then can be used to authenticate apexcov in a CI/CD pipeline. Works only with sandbox, scratch and Developer Edition orgs.
- While authenticated in your org (sandbox or scratch), navigate to the installation URL and follow the instructions there.
- In the Setup UI, assign the G-Force permission set to your user.
- Login to your org using any preferred method,
setting it as your default (
-s
flag). If you don't make it default, append-o <your_org_alias>
to the following commands - While authenticated to your org, run
sf package install -p [email protected] -w 5
- Assign the permission set with
sf org assign permset -n gfrc__G_Force
Once the permission set is assigned, you get access to the G-Force Lightning App. Open the app and follow the instructions there to connect to your Gitlab project and share the authentication information for your org with Gitlab.
The proposed workflow for using apexcov
with Gitlab CI/CD is to associate branches with environments. During the
package configuration, the user is presented with a list of branches from the project they selected. When the steps
in the package are complete, it creates a CI/CD variable APEXCOV_CONFIG
of type file with environment set to the name
of the branch. The APEXCOV_CONFIG
variable contains a JSON with auth info for the org suitable for passing to the
-config
flag of the apexcov
CLI. Creating this variable for the branch is called "claiming the branch".
Note
Protected branches and those that already have an APEXCOV_CONFIG
variable associated with them, don't show up in the
list of branches available to be "claimed".