{"id":15663126,"url":"https://github.com/melroy89/repo_pull_sync_docker_image","last_synced_at":"2025-07-29T02:34:35.159Z","repository":{"id":153090853,"uuid":"438044684","full_name":"melroy89/repo_pull_sync_docker_image","owner":"melroy89","description":"GitLab Repo mirror pull sync - Docker Image + GitLab Scheduled pipeline","archived":false,"fork":false,"pushed_at":"2022-03-05T16:58:09.000Z","size":9,"stargazers_count":25,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T00:17:41.588Z","etag":null,"topics":["cronjob","crontab","docker","gitlab","image","mirroring","pull","repo","repository","scheduler","syncer"],"latest_commit_sha":null,"homepage":"https://gitlab.melroy.org/melroy/repo_pull_sync_docker_image","language":"Dockerfile","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/melroy89.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-13T22:32:45.000Z","updated_at":"2024-11-05T14:08:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7d07170-125b-46ca-9366-8b295b2020ad","html_url":"https://github.com/melroy89/repo_pull_sync_docker_image","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/melroy89/repo_pull_sync_docker_image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melroy89%2Frepo_pull_sync_docker_image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melroy89%2Frepo_pull_sync_docker_image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melroy89%2Frepo_pull_sync_docker_image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melroy89%2Frepo_pull_sync_docker_image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melroy89","download_url":"https://codeload.github.com/melroy89/repo_pull_sync_docker_image/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melroy89%2Frepo_pull_sync_docker_image/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267619488,"owners_count":24116569,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cronjob","crontab","docker","gitlab","image","mirroring","pull","repo","repository","scheduler","syncer"],"created_at":"2024-10-03T13:35:33.903Z","updated_at":"2025-07-29T02:34:35.133Z","avatar_url":"https://github.com/melroy89.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitLab Repo Mirror Pull Sync - Docker Image + GitLab Scheduled Pipeline\n\nUseful Docker image that can be used in combination with a [GitLab Scheduled Pipelines](https://docs.gitlab.com/ee/ci/pipelines/schedules.html) for pulling remote repositories.\n\nNormally, GitLab Community Edition (GitLab CE) _only_ offers you to mirroring repositories via `push` direction. This Docker image with yaml file + scheduler allows you to sync a repository via **`pull` mirror direction**!\n\nHave the \"GitLab mirror pull\" feature for free, even when using GitLab CE! Use the steps below to get started.\n\n## Docker Image\n\nWe are following Docker image in our pipeline: [danger89/repo_mirror_pull](https://hub.docker.com/r/danger89/repo_mirror_pull) ([source](./Dockerfile))\n\n## GitLab Pipeline\n\n[GitLab Scheduled Pipeline](https://docs.gitlab.com/ee/ci/pipelines/schedules.html) yaml file (`.gitlab-ci.yml`). No changes are needed, the variables can be changed in the GitLab Schedule (see next heading).\n\nIf the rebase fails the pipeline aborts automatically (so no git push).\n\n```yml\nrepo_pull_sync:\n  image: danger89/repo_mirror_pull:latest\n  rules:\n    - if: '$CI_PIPELINE_SOURCE == \"schedule\"'\n    - if: $REMOTE_URL\n    - if: $REMOTE_BRANCH\n    - if: $ACCESS_TOKEN\n  before_script:\n    - git config --global user.name \"${GITLAB_USER_NAME}\"\n    - git config --global user.email \"${GITLAB_USER_EMAIL}\"\n  script:\n    - git checkout $CI_DEFAULT_BRANCH\n    - git pull\n    - git remote remove upstream || true\n    - git remote add upstream $REMOTE_URL\n    - git fetch upstream\n    - git rebase upstream/$REMOTE_BRANCH\n    - git push \"https://${GITLAB_USER_LOGIN}:${ACCESS_TOKEN}@${CI_REPOSITORY_URL#*@}\" \"HEAD:${CI_DEFAULT_BRANCH}\"\n```\n\n*Note:* If you want to use `git merge` instead of `git rebase` that is up to you. You can change the script above to your needs.\n\n## Create GitLab Schedule\n\nCreate Project Access token fist:\n\n* Go to: `Settings -\u003e Access Tokens`. Check 'api' as the scope. Save the secret token for later.\n\nCreate a new GitLab Schedule:\n\n* Go to: `CI/CD -\u003e Schedules -\u003e New schedule`. With the following 3 variables:\n  * `REMOTE_URL` (example: `https://github.com/project/repo.git`)\n  * `REMOTE_BRANCH` (example: `master`)\n  * `ACCESS_TOKEN` (see Access Token in the first step! Example: `gplat-234hcand9q289rba89dghqa892agbd89arg2854`)\n* Save pipeline schedule\n* Press the Play button to trigger the Schedule prematurely (for testing purpose)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelroy89%2Frepo_pull_sync_docker_image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelroy89%2Frepo_pull_sync_docker_image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelroy89%2Frepo_pull_sync_docker_image/lists"}