GitLab CI/CD: Build Docker Image & Push to Registry

GitLab CI/CD can be used with Docker to build Docker images.

For example, you can create a Docker image of your application and push it to a GitLab’s Container Registry.

In this note i am showing an example of how to create a new repository in GitLab with a CI/CD pipeline that will be used for building a “Hello World” Docker image and pushing it to a registry. (more…)

GitLab CI/CD: “Hello World” – Example

GitLab CI/CD is a part of GitLab that is used for continuous integration (CI), delivery (CD) and deployment (CD).

With GitLab CI/CD, you can automatically build, test and publish your software with no third-party application or integration needed.

In this note i am showing an example of how to create a new repository in GitLab with a “Hello World” CI/CD pipeline that will be triggered automatically on each commit and push to remote. (more…)

GitLab CI/CD: Print All Environment Variables

Environment variables are extremely useful as they bring a lot of flexibility to CI/CD jobs and pipelines in GitLab.

There are some predefined variables that are available in every GitLab CI/CD pipeline and custom variables that can be defined in different ways.

In this short note i will show how to list all the environment variables in GitLab CI/CD and print their values. (more…)

Git Alias: Config – The Best Git Aliases

An alias in Git is a shortcut that Git translates into a full-text command.

With the aliases you can avoid typing the entire text of each of the Git commands over and over again, that significantly improves the experience of working with Git from the command line.

In this note i will show how to set up the aliases in Git using the git config alias command. (more…)

Git Bash: Change Home Directory

The Home (~) directory in Git Bash can be changed by setting the user-level %HOME% environment variable in Windows.

This is quite safe as the %HOME% environment variable is not normally set for Windows applications, so creating it shouldn’t affect anything else.

Moreover, setting the user-level environment variable in Windows doesn’t require admin rights. (more…)