-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure.yaml
54 lines (53 loc) · 1.64 KB
/
azure.yaml
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## This yaml file keeps a clone
## @azure-devops up to date
## discards everything NOT in the
## public Github repo
name: keepCloneUpToDate
## Below is not necessary, for it to work,
## an endpoint is needed which may or may not
## already be there
## resources:
# repositories:
# - repository: github-ipv
# type: github
# name: IbrahimTanyalcin/I-PV
# endpoint: MyGitHubServiceConnection
variables:
REMOTE_ADDR: 'https://github.com/IbrahimTanyalcin/I-PV.git'
BRANCH_NAME: 'public'
schedules:
- cron: "30 * * * *" #there is 1000/pipeline hardcap, careful
displayName: refreshEvery30Min
branches:
exclude:
- master
include:
- public
always: true
stages:
- stage: running_git_commands
displayName: running_git_commands
jobs:
- job: initiate
displayName: initiate
continueOnError: false
steps:
- checkout: git://I-PV/I-PV@public
clean: true
persistCredentials: true
displayName: run_commands
- bash: |
git checkout $(BRANCH_NAME)
git remote add ipvGithub $(REMOTE_ADDR)
git fetch ipvGithub master
git fetch --tags -f ipvGithub +master
if [ $(git rev-parse @) != $(git rev-parse ipvGithub/master) ]
then
echo "commits NOT equal, rebasing"
git reset --hard ipvGithub/master
git pull --rebase ipvGithub master
git push --force origin $(BRANCH_NAME):$(BRANCH_NAME)
git push --tags --force origin $(BRANCH_NAME):$(BRANCH_NAME)
else
echo "commits equal, no need to pull"
fi