-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
30 lines (27 loc) · 895 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
stages:
- sync
run:
image: tabll/git:latest
stage: sync
tags:
- docker
before_script:
- git config --global user.name "Tabll"
- git config --global user.email "tabll@outlook.com"
script:
- mkdir work_dir
- cd work_dir
- git clone -b $CI_COMMIT_REF_NAME https://$git_user_name:$git_password@gitlab.tabll.cn/Tabll/gemnasium-db.git .
- mkdir sync_git
- git clone https://gitlab.com/gitlab-org/security-products/gemnasium-db.git sync_git
- shopt -s extglob
- cp -rf .gitlab-ci.yml sync_git
- rm -rf !(.git|sync_git)
- rm -rf sync_git/.git
- cp -rf sync_git/* .
- rm -rf sync_git
- git add .
- git commit -a -m "同步 `date +%Y-%m-%d`"
- git push https://$git_user_name:$git_password@gitlab.tabll.cn/Tabll/gemnasium-db.git $CI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"