2.7 KiB
2.7 KiB
Template for AMU thesis
The template itself is in the {{cookiecutter.thesis_type}}-{{cookiecutter.thesis_surname}}
.
In order to generate a project from the template:
- install cookiecutter
- find a cookiecutter-applica-pypackage release applicable (usually the latest release/tag listed at https://git.wmi.amu.edu.pl/filipg/cookiecutter-amu-thesis), say VERSION
- run:
cookiecutter https://git.wmi.amu.edu.pl/filipg/cookiecutter-amu-thesis.git --checkout VERSION
Interoperation with Overleaf
Overleaf handles git but it's very cr*ppy. It's better to upload a package to Overleaf first:
- Create a project locally.
- Run
make
- Run
make source-pack
- Upload the zip file to Overleaf.
- Copy project to some other place.
- Clone the repo from Overleaf:
git clone https://git.overleaf.com/FUNNY-OVERLEAF-CODE PAPERID-paper
- Set remotes:
git remote add overleaf https://git.overleaf.com/FUNNY-OVERLEAF-CODE
git remote set-url origin git@git.wmi.amu.edu.pl:YOURID/YOUR-GITLAB-REPO
- Set credential helper so that stupid Overleaf won't ask about
password:
git config credential.helper "cache --timeout=10000000"
- Unfortunately, Overleaf will discard hidden files (
.*
) when a zip is uploaded, also file permissions will be somewhat broken (did I tell you how much I hate Overleaf?) - … so you need to copy
.cookiecutter.yml
file and re-apply the template (cookiecutter https://git.wmi.amu.edu.pl/filipg/cookiecutter-amu-thesis.git --checkout VERSION --output-dir .. --config-file .cookiecutter.yml --no-input --overwrite-if-exists
) - Re-commit the files (including recovered
.*
files). - Push the repo to Overleaf (fortunately, the
.*
will be treated correctly when this is done by git):git push overleaf master
- Push the repo to GitLab.
git push origin master
- Set the Overleaf git remote in
helpers/vars
- Now you can synchronize between GitLab repo and Overleaf manually or using
helpers/synchro.sh
script
Updating package with updated template
To keep your codebase in sync with template you need to occasionally reapply the template. Here's how:
- find a cookiecutter-amu-thesis release/tag applicable, say VERSION
- (do not refer to master in your projects!)
- go to project root
- run:
cookiecutter https://git.wmi.amu.edu.pl/filipg/cookiecutter-amu-thesis.git --checkout VERSION --output-dir .. --config-file .cookiecutter.yml --no-input --overwrite-if-exists
- check changes with git
Releasing a new version of the template
- add an item to
CHANGELOG.md
- in case of breaking changes (M is incremented) describe clearly
what actions are to be taken in
CHANGELOG.md
- tag master with the version