If you can guarantee you'll only ever have one project you care about, sure, that's totally reasonable. My second thought is that I don't know if the project system ignores .git directories within the project or not.
My first thought was that if you ever have to change to VCSing multiple projects, it's going to be difficult/annoying to do that in a single transaction and preserve history on all your files. Maybe not a deal breaker - you could always have an archival repo and a brand new repo if you do end up needing to track multiple projects.
If you can guarantee you'll only ever have one project you care about, sure, that's totally reasonable.
Sometimes I will, sometimes I wonât. If itâs a job with multiple projects Iâd just make the repo the projects directory and use the .gitignore file like normal. Itâs not that much of a pain anyway, so maybe itâs written that way because itâs just best practice to do things the same way every time.
My second thought is that I don't know if the project system ignores .git directories within the project or not.
Thatâs what gave me pause. I wasnât sure how that would affect things. It doesnât seem like it because the .git folder is hidden, but you never know. I guess the only thing to do is try and test, if itâs even worth it, and Iâm doubting if it is.
With the release of 8.3, we now have a Version Control Guide on our docs page that may be useful. As part of the team who wrote the guide, it contains a lot of the same information included in the original post here, but updated for 8.3.
Thank you, Eric. This is a very comprehensive guide. I still struggle to see how the âadditive approachâ can be applied in a simple, practical way. I believe the real key would be integrating Git directly into the Designer. Without that, it seems difficult to fully take advantage of Gitâs benefits. In this regard, you might draw some inspiration from SAPâs âtransport requests.â
@Eric_Knorr Nice work, I have one recommendation for the project template, add â:rwâ to the end of your project volume in your compose file. This allows you to manage your git commits much easier and also allows you to directly edit you gateway scripts in your IDE, so you can use tools like cursor ect.
I havenât figured the correct way to reload the scripts back into designer, I often just restart the container since it only takes a few seconds in my dev environment.
@Eric_Knorr , I appreciate the guide. Iâm running into an issue that seems tied to the bind mounts I defined for Git. Each time I run docker compose up to recreate a container, the startup takes a long time, and a new temporary user profile is generatedâeventually leaving me with a long list of these profiles.
After experimenting, I found that adding a named volume alongside the Git bind mounts fixes the problem. Startup time improves, and no extra temporary user profiles are created.
@Craig_webber, when I discard changes in Git for a project and want to restore the original code in the Designer, I first trigger a project scan to update the Gateway.
There are two ways to do this in v8.3:
Use the API:
<ip>:<port>/data/api/v1/scan/projects
Call the system function to rescan the project folder:
system.project.requestScan([timeout])
Once the rescan completes, click the Merge Changes from Gateway button in the Designer (see screenshot below).
Hi Andrew, your method indeed does work, unless you destroy that volume. We have an internal ticket (IGN-14241) to streamline this process, but here's a little bit of insight on what is happening:
In order for Ignition to commission properly, the following need to exist:
Note: The resources in config can be overridden by a deployment mode, but the resource definition just has to exist somewhere)
Your approach works because the named volume persists commissioning.json and the core resource directories between container recreations. When you only bind-mount config/, these files don't exist yet on first startup, causing Ignition to create temporary profiles while attempting to commission.
A more robust solution is to use a bootstrap service that seeds the required files before Ignition starts. This way, you don't need to rely on a persistent volume that could be accidentally destroyed:
Eric, thanks for following up. I tried your approach, and it does work. On the first run, the Ignition Gateway fails to start up in the container, but after a restart everything comes up fine.
My only dislike with this solution is ending up with a stopped container for the bootstrap:
When I re-read your post, I realized the only thing missing for Ignition to properly commission was the commissioning.json file. To address this, I created a commissioning.json containing just {} and referenced it in my compose file:
With this setup, the first run still fails during commissioning but starts cleanly after a restart. From then on, there are no issues with the user profile when re-creating the gateway container, and I can safely commit the commissioning.json file into Git for team reuse. This also avoids the problem of losing a persisted volume, since a persisted volume is not in use in this approach.
Overall, this feels like a solid alternative approach , and Iâm curious to see how things change once internal ticket IGN-14241 is resolved.
I realized that my docker compose setup did not allow for updating files in the container. I needed to change file permissions to enable Git operations. In my docker compose file, I now reference an entrypoint.sh script that updates the file permissions in the container before Ignition starts.
With these changes, I can now update container files through Git operations. For example, when I discard changes in Git, it properly reverts the changes in the container. I can then trigger a project scan to update the project in the gateway, and finally use Merge Changes from Gateway to sync those changes into the Designer.