-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.update_fork_branches.yml
More file actions
81 lines (77 loc) · 3.86 KB
/
.update_fork_branches.yml
File metadata and controls
81 lines (77 loc) · 3.86 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.update_fork_branches: &update_fork_branches
stage: on-schedule
only:
- schedules
before_script:
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add the required SSH keys to the agent store
# We're using tr to fix line endings which makes ed25519 keys work
# without extra base64 encoding.
- echo "${SSH_KEY}" | tr -d '\r' | ssh-add - > /dev/null
- echo "${SSH_KEY_EIRENE_DEPLOY}" | tr -d '\r' | ssh-add - > /dev/null
# Create the SSH directory and give it the right permissions
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
# Use ssh-keyscan to scan the keys of your private servers.
- ssh-keyscan ${REPO_DOMAIN} >> ~/.ssh/known_hosts
- ssh-keyscan ${SERVER_DOMAIN} >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
# Change origin push URL to get write access to EIRENE repository
- git remote set-url --push origin git@${SERVER_DOMAIN}:eirene/eirene.git
retry: 2
update_fork_branches_ITER:
<<: *update_fork_branches
variables:
SSH_KEY: ${SSH_KEY_ITER}
REPO_DOMAIN: "git.iter.org"
REPO_URL: "ssh://git@git.iter.org/bnd/eirene.git"
script:
# Add ITER repository as additional remote
- git remote add -t master -t develop iter $REPO_URL || git remote set-url iter $REPO_URL
- git remote set-url --push iter no_push
# Fetch available branches from ITER
- git fetch iter
# Push branches to EIRENE repository
- git push -f -u origin iter/master:refs/heads/forks/iter/master
- git push -f -u origin iter/develop:refs/heads/forks/iter/develop
update_fork_branches_CEA:
<<: *update_fork_branches
variables:
SSH_KEY: ${SSH_KEY_CEA}
REPO_DOMAIN: "subversion.assembla.com"
script:
# Adjust ssh_config to pass required environment variables
- printf "Host cea-svn\n HostName subversion.assembla.com\n SendEnv REPO_NAME\n" >> ~/.ssh/config
# Get local copy of CEA SVN repository
- REPO_NAME=e-styx git svn clone svn+ssh://svn@cea-svn --stdlayout eirene_cea && cd eirene_cea && git checkout -b eirene_up2date origin/eirene_up2date || cd eirene_cea && REPO_NAME=e-styx git svn fetch
# Add CEA repository as additional remote
- cd ..
- git remote add -t master -t eirene_up2date cea eirene_cea || git remote set-url cea eirene_cea
# Fetch available branches from CEA
- git fetch cea
# Push branches to EIRENE repository
- git push -f -u origin cea/master:refs/heads/forks/cea/master
- git push -f -u origin cea/eirene_up2date:refs/heads/forks/cea/eirene_up2date
update_fork_branches_JET:
<<: *update_fork_branches
variables:
SSH_KEY: ${SSH_KEY_JET}
REPO_DOMAIN: "git.ccfe.ac.uk"
REPO_URL: "git@git.ccfe.ac.uk:jintrac/EIRENE.git"
# git@git.ccfe.ac.uk:jintrac/EIRENE_JUEL.git does not exist anymore
#REPO_NEW_URL: "git@git.ccfe.ac.uk:jintrac/EIRENE_JUEL.git"
script:
# Add JET repositories as additional remotes
- git remote add -t master -t develop jet $REPO_URL || git remote set-url jet $REPO_URL
#- git remote add -t JET_master -t v170517_NewJuel jet_new $REPO_NEW_URL || git remote set-url jet_new $REPO_NEW_URL
- git remote set-url --push jet no_push
#- git remote set-url --push jet_new no_push
# Fetch available branches from JET
- git fetch jet
#- git fetch jet_new
# Push branches to EIRENE repository
- git push -f -u origin jet/master:refs/heads/forks/jet/master
- git push -f -u origin jet/develop:refs/heads/forks/jet/develop
#- git push -f -u origin jet_new/JET_master:refs/heads/forks/jet_new/JET_master
#- git push -f -u origin jet_new/v170517_NewJuel:refs/heads/forks/jet_new/v170517_NewJuel