-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple remotes #172
Merged
Merged
Multiple remotes #172
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,20 +70,6 @@ | |
set_fact: | ||
dj_git_repo_scripts: "{{ DJ_GIT_REPO_SCRIPTS_RESTRICTED if WF_RESTRICTED_NETWORK else DJ_GIT_REPO_SCRIPTS }}" | ||
|
||
- name: Download offline repos | ||
when: WF_RESTRICTED_NETWORK | ||
block: | ||
- name: Create working copy of the domjudge-scripts repo | ||
become: true | ||
become_user: domjudge | ||
# We use a different directory here to have one single 'upstream' and not have issues with it | ||
git: repo={{ dj_git_repo_scripts }} dest=/home/domjudge/domjudge-scripts-checkout version=main accept_hostkey=yes update=no | ||
|
||
- name: Create working copy of the contest repo | ||
become: true | ||
become_user: domjudge | ||
git: repo=git@cds:{{ CONTEST_REPO }} dest=/home/domjudge/{{ CONTEST_REPO }} version=master accept_hostkey=yes update=no | ||
|
||
- name: Copy custom CSS file for admin machines | ||
copy: | ||
src: admin-machine.css | ||
|
@@ -151,3 +137,33 @@ | |
etype: user | ||
permissions: rwx | ||
state: present | ||
|
||
- name: Download offline repos | ||
when: WF_RESTRICTED_NETWORK | ||
become: true | ||
become_user: domjudge | ||
block: | ||
- name: Add ccsadmin remote | ||
git_config: | ||
name: "remote.{{ item.remote }}.url" | ||
value: "{{ item.url }}" | ||
scope: local | ||
repo: /home/domjudge/domjudge-checkout | ||
loop: | ||
- remote: origin | ||
url: [email protected]:domjudge | ||
- remote: github | ||
url: [email protected]:DOMjudge/domjudge.git | ||
- remote: sysops | ||
url: domjudge@packages:domjudge.git | ||
- remote: initial | ||
url: ansible@domjudge-ccsadmin1:domjudge.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the difference with origin? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One gets switched if the other git hosts get online, the other stays stable. |
||
|
||
- name: Create working copy of the domjudge-scripts repo | ||
# We use a different directory here to have one single 'upstream' and not have issues with it | ||
git: repo={{ dj_git_repo_scripts }} dest=/home/domjudge/domjudge-scripts-checkout version=main accept_hostkey=yes update=no | ||
|
||
- name: Create working copy of the contest repo | ||
ignore_errors: true | ||
git: repo=git@packages:{{ CONTEST_REPO }} dest=/home/domjudge/{{ CONTEST_REPO }} version=master accept_hostkey=yes update=no | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order does not matter for yaml, I checked and this does create those remotes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which one is the default remote?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We first clone first so that would be the
origin
, the idea is to change the origin when another host comes available.I verified on a VM and
origin
is the still default even after the other remotes get added.