GitLab Integration
Set up FirmwareCI integration with GitLab repositories using access tokens and webhooks.
Prerequisites
- Repository set up with
.firmwareciinfrastructure (see Repository Setup) fwciCLI tool authenticated
Setup Steps
1. Generate Access Token
Create a token with required permissions:
Option A: Personal Access Token
- Navigate to Settings > Access Tokens in your GitLab account
- Create a token with these scopes:
apiread_repositorywrite_repository
- Save the token securely
Option B: Project Access Token
- Navigate to Settings > Access Tokens in your GitLab project
- Create a token with the same scopes as above
- Save the token securely
2. Run Integration Command
Provide the access token when running integration:
$ fwci integration --gitlab-auth="YOUR_ACCESS_TOKEN"3. Configure Webhook
Set up the webhook in your GitLab project to enable automatic synchronization:
- Navigate to Settings > Webhooks in your GitLab project
- Add the webhook URL:
- URL:
https://api.firmwareci.9esec.dev:8443 - For self-hosted instances, use your FirmwareCI server URL
- URL:
- Secret Token: Contact FirmwareCI team for the secret token
- Trigger events:
- ☑ Push events
- ☑ Merge request events
- Click Add webhook
4. Verify Integration
Push a commit to trigger the first synchronization:
$ git add .firmwareci
$ git commit -m "Initialize FirmwareCI"
$ git pushCheck the commit in GitLab - you should see the FirmwareCI status appear.
How It Works
Automatic Synchronization:
- Default branch pushes: Trigger full synchronization of configuration to FirmwareCI server
- Merge request pushes: Run validation to catch configuration errors before merge
Status Reporting:
- Configuration validation results appear as commit status
- Test results are reported back to merge requests (see Job Triggers)
HTTPS Authentication
When synchronizing with HTTPS remotes fails, see these extra authentication options:
Environment Variables (Recommended):
export GIT_TOKEN=glpat-xxxxxxxxxxxx
export GITLAB_USERNAME=your_gitlab_usernameInteractive Prompt (Fallback):
Enter username for https://gitlab.com/owner/repo.git: your_gitlab_username
Enter token/password for https://gitlab.com/owner/repo.git: <your PAT>Generate Token:
Create a Personal Access Token with api and read_repository scopes.
CLI Synchronization
Consider synchronizing commits through the CLI without webhooks if the integrations does not work. See CLI Synchronization.
