April 27, 2021

How to Globally Gitignore Configuration Files

Until today, I did not make up my mind about what to do with configuration files, created by e.g. VS Code. Certainly, I do not want to commit them, but putting it into every’s repository .gitignore file is also cumbersome - and sometimes it is not possible. I always do a git add -u to avoid accidentally adding a venv or similar, so it did not really matter. Except… ❯ ....

March 23, 2021

How to Fix a Broken Rollback on Nixos, caused by mixed Python Environments

Today I tried to update a Nixos channel to 20.09.xxx, but the virtual machine was still running on 15.09, and seemingly the nix-version was pinned. I got an error saying something like the nix version is too low. I then tried to do a rollback, but then I got another following error: ERROR: ./batou --help Return code: 1 STDOUT Running unclean installation from requirements.txt Ensuring unclean install ... .batou/unclean/bin/python -m pip install -r requirements....

November 16, 2020

How to Configure Git for Testing

batou is a configuration management and deployment tool, comparable to Ansible. With batou you can deploy applications, also from git repositories. For this batou uses the git binary - so this has to be tested somehow. One test looks like this… def test_git_remote_init_pull(tmpdir): source = tmpdir.mkdir("source") dest = tmpdir.mkdir("dest") with source.as_cwd(): remote_core.cmd("git init") source.join("foo.txt").write("bar") remote_core.cmd("git add foo.txt") remote_core.cmd("git commit -m bar") remote_core.ensure_repository(str(dest), "git-bundle") remote_core.git_pull_code(str(source), "master") remote_core.git_update_working_copy("master") assert "bar" == dest.join("foo.txt").read() … and worked in some environments, even on Travis, but failed on my Ubuntu box, and later also on GH Actions:...