This document provides instructions for testing the GitLab CI/CD configuration locally before pushing to the repository.
- Node.js (v22.16.0 or higher)
- Yarn (v4.9.2 or higher)
- Docker
- GitLab Runner (optional, for local CI testing)
Before pushing to GitLab, you can test the scripts locally to ensure they work as expected:
yarn installyarn test:lintyarn testyarn test:ciyarn buildIf you have GitLab Runner installed, you can test the CI/CD pipeline locally:
-
Install GitLab Runner: https://docs.gitlab.com/runner/install/
-
Run a specific job:
gitlab-runner exec docker lint
gitlab-runner exec docker test-server
gitlab-runner exec docker buildThe CI/CD pipeline supports different workflows controlled by variables:
-
WORKFLOW: The workflow to executebuild: Run tests and build the applicationdeploy: Deploy the application to the specified environmentrebase: Rebase and deployrebase-all: Republish all content
-
ENV: The deployment target environmentstaging: Deploy to staging environmentproduction: Deploy to production environment
-
VERSION: The version or branch name to deploy
# In GitLab CI/CD interface, run a pipeline with:
WORKFLOW=build# In GitLab CI/CD interface, run a pipeline with:
WORKFLOW=deploy
ENV=staging
VERSION=mainIf you encounter issues with the CI/CD pipeline:
- Check the job logs for specific error messages
- Verify that all required environment variables are set
- Ensure that the Docker image can be built locally
- Check that the Heroku API key is correctly configured