{"id":14008497,"url":"https://github.com/mdubourg001/glci","last_synced_at":"2025-04-13T02:11:07.743Z","repository":{"id":37646942,"uuid":"339543580","full_name":"mdubourg001/glci","owner":"mdubourg001","description":"🦊 Test your Gitlab CI Pipelines changes locally using Docker.","archived":false,"fork":false,"pushed_at":"2021-12-21T13:02:05.000Z","size":512,"stargazers_count":571,"open_issues_count":10,"forks_count":16,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-30T02:37:32.771Z","etag":null,"topics":["ci","docker","gitlab","gitlab-ci","jobs","pipelines"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdubourg001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-16T22:04:16.000Z","updated_at":"2024-09-27T10:54:45.000Z","dependencies_parsed_at":"2022-07-10T18:00:24.777Z","dependency_job_id":null,"html_url":"https://github.com/mdubourg001/glci","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdubourg001%2Fglci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdubourg001%2Fglci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdubourg001%2Fglci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdubourg001%2Fglci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdubourg001","download_url":"https://codeload.github.com/mdubourg001/glci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654090,"owners_count":21140236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","docker","gitlab","gitlab-ci","jobs","pipelines"],"created_at":"2024-08-10T11:01:44.230Z","updated_at":"2025-04-13T02:11:07.724Z","avatar_url":"https://github.com/mdubourg001.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# glci 🦊\n\nEase GitLab CI Pipelines set-up by running your jobs locally in Docker containers.\n\nWhy ? Because I did not want to commit, push, and wait for my jobs to run on the GitLab UI to figure I forgot to install `make` before running `make build`.\n\n📣 Disclaimer: this is a helper tool aiming to facilite the process of setting up GitLab CI Pipelines. glci **does NOT** aim to replace any other tool.\n\n## Installation\n\nYou need to have Docker installed and running to use glci.\n\n```bash\nyarn global add glci\n```\n\n## Usage\n\nAt the root of your project (where your `.gitlab-ci.yml` is):\n\n```bash\nglci\n```\n\n⚠️ You might want to add `.glci` to your `.gitignore` file to prevent committing it.\n\n## Options\n\n### `--only-jobs [jobs]`\n\nLimiting the jobs to run to the comma-separated list of jobs name given. Handy when setting up that stage-three job depending on that first-stage job artifacts.\n\nExample:\n\n```bash\nglci --only-jobs=install,test:e2e\n\n# \"build\" and \"test:unit\" won't be ran here\n#\n# -----------     ---------     -------------\n# | install | --- | build | --- | test:unit |\n# -----------     ---------  |  -------------\n#                            |\n#                            |   ------------\n#                            --- | test:e2e |\n#                                ------------\n```\n\n### `--yml \u003cyml_file_path\u003e`\n\nSetting the file to use in place of `.gitlab-ci.yml` (default to `.gitlab-ci.yml`). Useful when testing parent-child pipelines.\n\n### `--dir \u003cdirectory_name\u003e`\n\nChanging the directory where glci keeps cache and artifacts between jobs. Defaults to `.glci`.\n\n### `--clean`\n\nRemoving the directory given to `--dir` (default to `.glci`) before running glci.\n\n### `--no-draw`\n\nNot drawing the representation of the pipeline before running jobs.\n\n## Cool stuff\n\n- If a `.env` file exists next to your `.gitlab-ci.yml`, variables inside it get automatically parsed and added to the containers\n- Most of the pre-defined environment variables normally set by GitLab CI are also set here: see [pre-defined.js](/pre-defined.js)\n\n## Pulling images from private registries / repositories\n\nTo be able to pull images from private registries / repositories, glci copies a GitLab CI mechanism: the `DOCKER_AUTH_CONFIG` env variable (see https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#configuring-a-job).\n\nAs glci automatically reads the `.env` file at the root of your project, you can set a `DOCKER_AUTH_CONFIG` inside it as you would do it in GitLab CI/CD variables configurations and you should be able to pull images from your private registries.\n\nDon't forget to add this `.env` file to your `.gitignore`.\n\n## How does it work ?\n\nIt's pretty straightforward:\n\n- it parses your `.gitlab-ci.yml` file (and its \"includes\")\n- it runs each job of each stage (serially) in a Docker container created on the fly using the right image\n- it logs the results in the console\n- it shares the `cache` and the `artifacts` between jobs using Docker volumes\n- it automatically stops and removes the containers and the volumes created\n\n## Roadmap\n\n- Handle glob in `cache:paths` and `artifacts:paths`\n- Handle `artifacts:exclude` (supports globs too)\n- Add `--env` to allow defining / overriding env variables\n- Add `--in-vagrant` to run docker in Vagrant (not faster even on Mac for what I've tried)\n- Prevent sharing artifacts between same-stage jobs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdubourg001%2Fglci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdubourg001%2Fglci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdubourg001%2Fglci/lists"}