summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: bd46c9e141d39f3eca314746b4883d2a3965caa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
stages:
  - mirror

mirror-from-cgit:
  stage: mirror
  image: ubuntu:20.04
  before_script:
    - apt-get update -y && apt-get install -y git
    - git config --global user.name "CI"
    - git config --global user.email "ci@gitlab.com"
  script:
    - git clone --mirror "$SOURCE_REPO" temp_repo
    - cd temp_repo
    - TARGET_REPO="https://oauth2:$GITLAB_TOKEN@$REPO_NAME"
    - git remote set-url origin "$TARGET_REPO"
    - git push --prune --mirror
  only:
    - schedules