Skip to content

Build Gear (v1)

How to build your project as a Gear with apiVersion: v1.

Docker image with artifact

Dockerfile file

This simply requires you to put the gear in the image:

FROM scratch

LABEL gsf.package="true"

COPY git-system-follower-package /git-system-follower-package

Build & publish your Gear:

docker build -t <image>:<tag> .
docker push <registry>/<image>:<tag>

For details about when the gsf.package label is required, see Image Labels.

OCI artifact

Recommended option when you build your Gear as an OCI artifact.

Publish your Gear:

oras push <your registry> git-system-follower-package/

Package file structure

<your repository>
├─ git-system-follower-package/
│  ├─ package.yaml
│  └─ scripts/
│     └─ ...
└─ <your other files>

The scripts/ directory may contain cookiecutter templates/ directories and/or files/ directories for static files. See Gear structure types and Static files for the full layout.

package.yaml

Example:

apiVersion: v1
type: gitlab-ci-pipeline
name: my-first-gear
version: 1.0.0

For the full description of the v1 package.yaml sections, see apiVersion v1.

Develop API

v1 package scripts import the package API from the v1 surface:

from git_system_follower.develop.api.v1 import Parameters
from git_system_follower.develop.api.v1.templates import create_template

For backward compatibility the unversioned git_system_follower.develop.api import continues to work. See the Develop Interface reference.