Modern websites typically include both static and dynamic content. Something is pre-defined, something is generated using data gathered elsewhere and HTML templates. And when a single website has different means of producing the final pages from other content, it may be tricky to keep everything in order. Read on to see how we at Trustica use Gitlab CI to aid us with deploying Cryptoucan™ product website!
New Cryptoucan™ product website is built basically from three types of data:
To make our life easier, the whole website sources are stored and versioned in git. No matter if I am writing some strange conversion script or my colleague is adding a new guide, git helps is keeping track of everything. On top of git, we use private Gitlab instance that gives us both project management tools like issue boards and also Continuous Integration / Continuous Development runner.
There are three CI/CD stages in our workflow:
The build stage – of course – builds the static website from all the resources provided. It converts MarkDown documents into HTML using pandoc, it copies all the images into proper locations and it generates the required lists. Now comes the clever part. The test stage is actually identical to the deploy stage. The only difference is that it deploys the website onto a server in our internal network and we can see if all the changes and additions are OK before we publish them.
The trick here is that the last stage can only be run manually. With this setup, the workflow is absolutely smooth. We add guides or update some images or even add some generated content and we push the changes to git. Then we wait a minute or two and we can see if everything went OK and if the result is what we wanted it to be. Publishing it on the actual website is then just a matter of single click on the Play button for the last stage in the CI/CD pipeline.
Thank you for reading this rather descriptive article and see you next week with some news about shipping!
3. Wikipedia contributors. (2019, November 11). Markdown. In Wikipedia, The Free Encyclopedia. Retrieved 07:31, November 14, 2019, from https://en.wikipedia.org/w/index.php?title=Markdown&oldid=925624342
4. Wikipedia contributors. (2019, November 13). HTML. In Wikipedia, The Free Encyclopedia. Retrieved 07:31, November 14, 2019, from https://en.wikipedia.org/w/index.php?title=HTML&oldid=925951832
5. Wikipedia contributors. (2019, September 25). Pandoc. In Wikipedia, The Free Encyclopedia. Retrieved 07:32, November 14, 2019, from https://en.wikipedia.org/w/index.php?title=Pandoc&oldid=917834727
6. git –fast-version-control, available online at https://git-scm.com/
7.GitLab, available online at https://about.gitlab.com/
8.Issue Boards, available online at https://about.gitlab.com/product/issueboard/
9. Cryptoucan™ firmware CD, available online at https://trustica.cz/en/2018/11/08/cryptoucan-firmware-cd/