Skip to content

Implementation of Continuous integration

Finish the implementation of the CI Intergration file.The main solution: Autobuild + Auto Tagging & push refs.The CI will be triggered as long as the master or the dev branch is updated, and build output is auto-generated into a new tag of format ci/dev/xxxxxxx or ci/mas/xxxxxxx if the building is successfully.What's more, we here provides another working version for the users - the gitlab-ci.yml(instead of the .gitlab-ci.yml) is bound to provide the users the auto-compilation feature as long as they setting it up and replaced it with the .gitlab-ci.yml in their own forked repositories.(That is , maybe they won't need to compile the tex files on their own computer and let gitlab runner to finish this for them).

The first problem is the Chinese Support and xelatex environment.For the intergration configuration file , we use the docker image ablu/ubuntu-texlive-full which provided us the Ubuntu 16.04 Xenial + texlive 2017 environment for the base of the compilation.Even though the image is large(~3GB approx.), the building process is endurable since the typical ci build for the gitlab shared runner takes approx. 5 minutes per commit.(If nothing had stucked in the shared runner queue).For the Chinese support we requires the language-pack-zh-hans package, which will be automated installed during CI build process.

The font issue is a great problem, since we need to use the Times New Roman to be our main font, it does contains copyright problem since it's copyright to Microsoft. Opensource Solution often provides Nimbus Roman No9 L, which is an open source URW Postscript version of Times Roman(A slightly different Times New Roman-styled font in macOS).Hence, the font we choose to build CI process is this font(With GNU license).For the Chinese font, we continue choose to use the original Fandol fontsets provided by texlive. Since the font of the Nimbus Roman No9 L is not a must for the project itself(In every platform they can get the accurate and nice fonts for themselves by using different fontsets), we pulled it out from the project, and stored it to another git repo.Moreover, we didn't need to change the definition in sysuthesis.cls, since the font of Nimbus Roman is only used in the CI process, a tiny sed program would take care of the definition replacement within the CI build process.

The third problem, however, I think is the most challenging problem. Since we do not provide a static deploy server to store the build output, as long as the gitlab CI build service does not support the auto commit in repo as the Travis CI do. We need to set up and configure it by using raw commands.By using specific SSH tokens for the runner and setting the token to the secret variable within the specific environment, as long as the specific branch to be protected(E.g. Only allowed members instead of all developers can be pushed and modify to), this way can provide certain security to the project.Even if the SSH key is leaked, the protected branchs(Eg, dev, master) are still safe. At the same time, the administrator of the project can remove and then change the secret variable and the certain SSH key. (Well, from my own perspective, at the moment it's a working version although it should have better solution in the future).

As well as the set-up method, this modification needs the further set-ups for the permissions.The majority issues are:

  • I've registered a gitlab account thesisci for the specify agent used for the CI to completed the tagging and ref-pushing job, if is needed for this solution, please granted the account thesisci with developer permission to the folder(While I'm currently using my own account), and then lock the dev/master branch(set to protected, only granted pushing permissions to specific users).
  • The secret variables has been set up. Furter optimization is required.

Meanwhile, if everything goes well, merging this into dev will not make any build errors.However, for continuous usage and builds , we do need a specific account for CI Runner to take care of the tagging&ref-pushing processes.

The CI leads to successfully commits in a20185/thesis:dev, for the tagged result, please refer to the newest builds tag on dev and see for the compiled outputs. The tags which are:

  • ci/dev/7051415
  • ci/dev/3192da8
  • ci/dev/6535ec9
  • ci/dev/61c68a6 or the even more newer pushes.
Edited by Souler Ou

Merge request reports

Loading