Hi all,
I believe that having a simple project structure, combined with a versioning system and good changelog is very important. However, it’s very hard to set it up right. Looking around on GitHub, most (big) repositories have fixed this one way or the other. And most Balena repositories also have a nice versioning system with automated changelog. But how do you set it up, what to use etc.
I’m probably not the only one struggling with these questions, so I thought, why not create a topic about it.
First, the project structure. I made some projects in the past for Balena and setting up the structure at the beginning of a project is always a real struggle for me. Do I use the same as last time? Did I like that structure? Can I improve it this time?
Most of the time I’m creating multi-container projects for Balena and Node.js or Golang projects to run on servers. For the Node.js and Golang projects, I’m trying to use the basics they’ve created for those projects. But for a multi-container Balena project, you can have Node.js, Golang and other containers inside one project. What’s the “best-practice” to set this up and attaching a version to it?
My structure is as follows:
- docker-compose.yml
- README.md
- .dockerignore
- .gitignore
- container-1-directory (e.g. webservice)
- Dockerfile.template
- entry.sh
- directory with contents (e.g. Node.js)
- container-2-directory (e.g. redis)
- container-3-directory (e.g. frontend)
The structure is ok (imo), but should I split the containers to repositories and version them there, keep the commits there and use git submodules in the “main” repository? The main downside is that the changelog of the whole project is divided over multiple repositories instead of in 1 place.
I’m curious what the structure is of other Balena users!
Next up, versioning.
I saw Balena made their versioning system open source, which is awesome! But is this still the versioning system you guys use in all of your projects?
I have some questions about how other people version their projects.
- Do you use automated versioning? And if so, what do you use?
- Where do you begin when setting up versioning in a project / repository?
- How do you (automatically) validate if commits are using the right formatting? (like, add
Change-type
orChangelog-entry
to the footer) - Do you use Pull Requests to create versions and automated changelogs or commits?
- Any tips / tricks to begin with versioning your project / repository?
Like I said, I’m mostly using Node.js and Golang for projects, but versioning is useful for all of your repositories. So I’m looking for a way to implement a versioning system that can be used in all repositories, with automated changelogs.
I’d like to thank everyone in advance who’s willing to read all of this and help me (and others) out!
Regards,
Bart