-
Notifications
You must be signed in to change notification settings - Fork 0
/
20221229-Pipeline sync repo
27 lines (25 loc) · 1.06 KB
/
20221229-Pipeline sync repo
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
###Use runner sync repo from gitlab public
sync-with-gitlab:
image: bitnami/git:latest
before_script:
- cd ~
- git init
- git config --global user.name "devops"
- git config --global user.email "[email protected]"
script:
- git remote add origin https://oauth2:[email protected]/testvn-click-devops/container/mobile-app.git
- git pull origin main
- git push https://root:[email protected]/devops/source-code/mobile-app.git HEAD:master
sync-with-gitlab:
image: bitnami/git:latest
before_script:
- cd ~
- git init
- git config --global user.name "devops"
- git config --global user.email "[email protected]"
script:
- git remote add origin https://$TOKEN_GITLAB_PUBLIC@$REPO_GITLAB_PUBLIC
- git pull origin main
- git push https://$TOKEN_GITLAB_PRIVATE@$REPO_GITLAB_PRIVATE HEAD:$BRANCH_PUSH
Trigger Pipeline from curl
curl -L -X POST 'https://gitlab.testvn.click/api/v4/projects/4/trigger/pipeline?ref=main&token=glptt-2087a4cb455221110e733a2dcd9da396dc8fc494'