1
0
mirror of https://github.com/hegerdes/gitlab-actions.git synced 2025-10-06 05:36:52 +02:00
2023-12-22 22:46:59 +00:00
2023-12-22 23:23:37 +01:00
2023-12-22 22:29:31 +01:00
2023-12-22 23:45:58 +01:00
2023-12-22 23:23:37 +01:00
2023-12-22 22:46:59 +00:00
2023-12-22 22:23:05 +00:00
2023-12-22 23:45:58 +01:00

GitLab CI/CD Components

CI/CD Release

This repo contains a collection of different GotLab CI/CD Components.

Currently suporrted are:

Container Build: Kaniko

Usage

Use this component to build container images in your project without the need of a privileged Docker runner. It uses Googles kaniko project to allow safe image builds in Docker or Kubernetes. It automataticly adds metadata labels to the image for easy tracking when the image is deployed. You should add this component to an existing .gitlab-ci.yml file by using the include: keyword.

include:
  - component: gitlab.com/hegerdes/gitlab-actions/container-build@<VERSION>

where <VERSION> is the latest released tag or main. This will add a container_build job to the pipeline.
NOTE: By default the latest version of kaniko is used. For a more predictable outcome you should pin the version to a specific tag via the build_image input.

The template should work without modifications but you can customize the template settings.

Inputs

Input Default value Description
stage build The stage where you want the job to be added
build_image gcr.io/kaniko-project/executor:debug The Docker image of kaniko
force_run false When set to true it always adds the job even if $CONTAINER_SCANNING_DISABLED is set
push true When set to true the image will be pushed to the default registry. Set to false to only build without pushing the image.
kaniko_use_cache false When set to true kaniko will push build cache layers to the registry. Currently only the gitlab registry is supported.
image_tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG The name/path of the image to build.
context $CI_PROJECT_DIR The kaniko/docker build context.
dockerfile $CI_PROJECT_DIR/Dockerfile The path to the Dockerfile.
authors $CI_COMMIT_AUTHOR For OCI image label: Name of the image author(s).
source_url $CI_PROJECT_URL For OCI image label: Url of the source code.
project_url $CI_PROJECT_URL For OCI image label: Url of the project.
documentation_url $CI_PROJECT_URL For OCI image label: Url of the documentation.
version $CI_COMMIT_REF_NAME For OCI image label: Version of the image.
description $CI_PROJECT_DESCRIPTION For OCI image label: Description.
base_img_name UNKNOWN For OCI image label: Base image name.
vendor UNKNOWN For OCI image label: Vendor name.
license UNKNOWN For OCI image label: License.

Variables

Variable Description
GIT_STRATEGY Default to fetch.
DOCKER_AUTH_CONFIG GitLab variable containing registry secrets.

For details, see the following links:

Contribute

Please read about CI/CD components and best practices at: https://docs.gitlab.com/ee/ci/components

Description
Collection of GitLab CI-CD-Catalog actions. Allows users to build Docker/OCI Container Images.
Readme BSD-2-Clause 176 KiB
Languages
Shell 88.8%
Smarty 7.7%
Python 3.2%
Dockerfile 0.3%