Category: CI/CD
-
GitLab CI/CD: Weird Tag Behavior
While setting up Publisher for a private company, I found weird behavior: the tags from previous job is carried over to the release job. This causes problem because it triggers unnecessary tag releases. To fix this, just set the GIT_STRATEGY variable to clone instead of fetch. Reference: https://docs.gitlab.com/ee/ci/runners/configure_runners.html#configure-runner-behavior-with-variables See the change context here: https://gitlab.com/chez14/publisher/-/commit/d1f7cb50c5d0461b182c622fc2bed395e56f6c26. This…
-
Building Rust in Docker: Utilize Build Cache Properly!
From lucretiel‘s Tweet, which lead to one of his project’s Dockerfile… When building Rust in Docker, to cache the build, we can just add empty main.rs file, then run cargo build to build the dependencies first. Because the layer is cached, the built dependencies also cached too! After that, we can just import the rest…
-
GitLab CI: Use `!reference` to Extend Rules
In The Same File We can extend GitLab rules section with !reference [.hiddenjobname, section name]. Here’s an example: Reasons: Resources: In Template File (via include: keyword) Have not yet tried x.x TODO: Try to do this.