The
update.shscript distributes a GitLab assignment repository detaching its history into multiple solver repositories. For future updates it creates a separatesourcebranch and creates pull requests into main branch whenever updated. For newly created repositories the script duplicates issues withassignmentlabel and sets assignee and developer rights for existing users. This project also provides GitLab CI template (see below).
- Installed
jq, see https://stedolan.github.io/jq/ - Installed
gitwith defined user and email - Existing (working) project with assignment branch or assignment project
- GitLab account
- List of solvers, possibly as GitLab user accounts
-
To install locally, simply clone this project and set an alias.
git clone https://github.com/InternetGuru/cad.git echo alias cad=\"$PWD/cad/update.sh\" >> ~/.bashrc source ~/.bashrc -
For global installation, clone into shared folder and create a symbolic link.
sudo git clone https://github.com/InternetGuru/cad.git /usr/local/src sudo ln -s "/usr/local/src/cad/update.sh" /usr/local/share/cad
-
Clone a GitLab assignment project and distribute it into individual solver repositories.
git clone https://gitlab.com/umiami/george/csc220/matrix cad -n "umiami/george/csc220/sols" -f matrix -u "user1 user2" -
Clone GitLab assignment project into individual solver repositories on specific branch replacing README remote links. This is equivalent to our example of CI usage (below).
git clone https://gitlab.com/umiami/george/csc220/matrix git -C matrix checkout fall20 cad -rn "umiami/george/csc220/fall20/matrix" -f matrix -u "solver1 solver2 solver3"
-
Make sure you have your personal access token. On GitLab set ACCESS_TOKEN variable into your root namespace.
- E.g. into
umiami/george
- E.g. into
-
Navigate into the project and switch to the branch you want to distribute. Make sure the branch is protected.
-
Add the following lines into your
.gitlab-ci.ymlfile and insert users intoUSERSvariable separated by space, e.g."solver1 solver2 solver3". You may want to select a differentupdate.shrevision. Do not modifyCAD_REVISIONvariable unless you know what you're doing.include: 'https://raw.githubusercontent.com/InternetGuru/cad/master/gitlab-distribute.yml' variables: USERS: "" CAD_REVISION: "1" stages: - distribute -
To distribute the assignment, run distribute stage in CI pipeline on desired branch. Destination namespace for assignment projects is
project_namespace/project_branch/project_name.- E.g. destination namespace is umiami/george/csc220/fall20/matrix
- Integrate linting check (Shellcheck).
- Enhance automatic testing (BUTT).
- Add changelog and semantic versioning (git flow).
- Configurable destination projects visibility (private / public).
- Standalone assignment support with no base project or with no git at all.
- Support --quiet / default / --verbose mode.
- Set users as developers by parameter
-d,--developer=ALWAYS|AUTO|NEVER(defaultAUTO). - Introduce dry run to verify parameters and print out destinations.
- In distributed projects make the
sourcebranch protected. - Specify editable files.
- Add GitHub support.
- Add source project visibility check.
- Distribute issues into newly created repositories.