The release of GitLab 14.2 brings an exciting new feature to the management of CI/CD pipelines. Stages can now be completely omitted. Instead, the dependencies between pipeline jobs can be specified using the needs keyword. In this article, I will go into these changes and show you an example pipeline definition file making use of stageless pipelines. Traditionally, CI/CD pipelines in GitLab would consist of multiple stages and each stage would contain multiple jobs: The reasoning behind this structure was ...

GitLab version 13.8 was released on Jan 22, 2021 and ships with a new Pipeline Editor feature. Let’s look into it. Pipelines in CI/CD systems are traditionally created in text form. Whether Jenkins, CircleCI or GitLab – you usually start your pipeline in your favourite text editor. With CI/CD processes gaining more attention by all kinds of developers, this practice is now questioned since text-based formats are said to be less user-friendly than graphical UIs. GitLab’s vision is to have ...

Many applications are automatically tested on each commit inside a GitLab pipeline. If your application relies on a database such as PostgreSQL, it can be tempting to use an in-memory database such as H2 for tests because it is easier to set up and destroy for each execution of your test suite. While this works for simple applications, it is no longer possible once you rely on vendor-specific SQL features (e.g., usage of column types not available in H2). In ...

Sometimes I want to quickly save some code changes that I am not ready to commit into a real branch. For example, I might be in the middle of a long refactoring and there is a complete mess that I do not want to show up in version control history: Git has the “stash” command which removes all uncommitted changes and saves them to a local data structure where they can be retrieve later. However, this comes at the disadvantage ...

GitLab offers to create personal access tokens to authenticate against Git over HTTPS. Using these tokens is a secure alternative to storing your GitLab password on a machine that needs access to your repository. It is also the only way to automate repository access when two-factor authentication is enabled. However, GitLab does a poor job documenting how you actually use these tokens. Create an Access Token Navigate to “User Settings” > “Personal Access Tokens” and enter a name and, optionally, ...

In many git workflows, all changes to your code should eventually end up in the master branch. You may also have a develop branch which contains code changes that are not ready for production deployment yet. For some reason or another, you may end up in a situation where your develop has changed so much that you can no longer easily merge it into master. Most of those reasons suggest bad practices, but such a situation may also arise due ...

Directed Acyclic Graph (DAG) style dependencies between individual stages in a continuous deployment pipeline allow for a more flexible workflow and better utilize available computational resources. Imagine a simple pipeline consisting of three jobs: A syntax check A code complexity check Running all unit tests You may be tempted to group those in two stages: A) Build (consisting of jobs 1 and 2) and B) Test (consisting of the unit tests): Traditional Sequences In plain old GitLab pipelines, you would ...

Easily share your code with the PHP community by contributing your library as a composer package: This article will show you how to publish your code on GitLab and as a package on packagist.org. Writing Your PHP Code Publishing open source code has never been easier. Using PHP’s package manager composer, thousands of freely available packages are only one composer require away. Believe it or not, but there exists an npm package named “is-odd” with over 700,000 weekly downloads. Its ...

This article describes how to setup a continuous integration pipeline in GitLab for your Vue.js app. Learn how to automate your deployment to GitLab pages in a few easy steps. GitLab pages is a great way to host simple web applications and is easy to integrate into GitLab’s continous integration (CI) pipeline. ...

Bernhard Knasmüller on Software Development