### Minikube Start Output Example Source: https://docs.gitlab.com/charts/development/minikube Illustrates the expected output when starting a Minikube cluster, including VM initialization, ISO download, IP address assignment, and cluster component setup. Note the cluster IP for future reference. ```shell Starting local Kubernetes v1.7.0 cluster... Starting VM... Downloading Minikube ISO 97.80 MB / 97.80 MB [==============================================] 100.00% 0s Getting VM IP address... Moving files into cluster... Setting up certs... Starting cluster components... Connecting to cluster... Setting up kubeconfig... Kubectl is now configured to use the cluster. [helm.gitlab.io]$ minikube ip 192.168.99.100 [helm.gitlab.io]$ minikube stop Stopping local Kubernetes cluster... Machine stopped. ``` -------------------------------- ### Example Devfile Configuration Source: https://docs.gitlab.com/ee/user/workspace This devfile defines components for tooling and database containers, along with commands for installation, setup, and initialization, and specifies post-start events. ```yaml schemaVersion: 2.2.0 variables: registry-root: registry.gitlab.com components: - name: tooling-container attributes: gl/inject-editor: true container: image: "{{registry-root}}/gitlab-org/remote-development/gitlab-remote-development-docs/ubuntu:22.04" env: - name: KEY value: VALUE endpoints: - name: http-3000 targetPort: 3000 - name: database-container attributes: overrideCommand: false container: image: mysql command: ["echo"] args: ["-n", "user-defined entrypoint command"] env: - name: MYSQL_ROOT_PASSWORD value: "my-secret-pw" commands: # Command 1: Container 1, no working directory (uses project directory) - id: install-dependencies exec: component: tooling-container commandLine: "npm install" # Command 2: Container 1, with working directory - id: setup-environment exec: component: tooling-container commandLine: "echo 'Setting up development environment'" workingDir: "/home/gitlab-workspaces" # Command 3: Container 2, no working directory (uses container default) - id: init-database exec: component: database-container commandLine: "echo 'Database initialized' > db-init.log" # Command 4: Container 2, with working directory - id: setup-database exec: component: database-container commandLine: "mkdir -p /var/lib/mysql/logs && echo 'DB setup complete' > setup.log" workingDir: "/var/lib/mysql" events: postStart: - install-dependencies - setup-environment - init-database - setup-database ``` -------------------------------- ### GDK Setup: Start Services Source: https://docs.gitlab.com/development/data_seeder Starts the PostgreSQL and Redis services required for GDK. ```shell $ gdk start db ok: run: services/postgresql: (pid n) 0s, normally down ok: run: services/redis: (pid n) 74s, normally down ``` -------------------------------- ### Get Started Page Markdown Format Source: https://docs.gitlab.com/development/documentation/topic_types/get_started This markdown structure outlines the recommended format for a 'Get started' page, including title, overview, diagram, and structured steps with links. ```markdown title: Get started with abc --- These features work together in this way. You can use them to achieve these goals. Include a paragraph that ties together the features without describing what each individual feature does. Then add this sentence and a diagram. Details about the diagram file are below. The process of is part of a larger workflow: ![Workflow](img/workflow diagram.png) ## Step 1: Do this thing Each step should group features by workflow. For example, step 1 might be: `## Step 1: Determine your release cadence` Then the content can explain milestones, iterations, labels, etc. The terms can exist elsewhere in the docs, but the descriptions on this page should be relatively brief. Finally, add links, in this format: For more information, see: - [Create your first abc](link.md). - [Learn more about abc](link.md). ## Step 2: The next thing Don't link in the body content. Save links for the `for more information` area. For more information, see: - [Create your first abc](link.md). - [Learn more about abc](link.md). ``` -------------------------------- ### API Introduction Examples Source: https://docs.gitlab.com/development/documentation/restful_api_styleguide Use these examples to start API introductions, directing users to relevant features or documentation. ```text Use this API to manage [Git branches](path/to/file). ``` ```text Use this API to interact with the [Maven package manager client](path/to/file). ``` ```text Use this API to interact with namespaces, a special resource category used to organize users and groups. For more information, see [namespaces](path/to/file). ``` -------------------------------- ### Start GitLab Services (Source Installation) Source: https://docs.gitlab.com/administration/raketasks/user_management Starts GitLab services when installed from source. ```shell sudo /etc/init.d/gitlab start ``` -------------------------------- ### Install and Start Jenkins Source: https://docs.gitlab.com/development/integrations/jenkins Installs Jenkins using Homebrew and starts the Jenkins service. Ensure Homebrew is installed and configured on your macOS system. ```shell brew install jenkins brew services start jenkins ``` -------------------------------- ### Install and Start GitLab Runner (System Account) Source: https://docs.gitlab.com/runner/install/windows Installs and starts the GitLab Runner service using the Built-in System Account. This is the recommended method for running the service. ```powershell cd C:\GitLab-Runner .\gitlab-runner.exe install .\gitlab-runner.exe start ``` -------------------------------- ### Install and Start GitLab Runner Service Source: https://docs.gitlab.com/runner/install/osx Installs the GitLab Runner service by creating a LaunchAgent plist and registers it with launchctl, then starts the service. This command should be run from the user's home directory. ```shell cd ~ gitlab-runner install gitlab-runner start ``` -------------------------------- ### Install and Start GitLab Runner (User Account) Source: https://docs.gitlab.com/runner/install/windows Installs and starts the GitLab Runner service using a specified user account. Requires valid username and password. ```powershell cd C:\GitLab-Runner .\gitlab-runner.exe install --user ENTER-YOUR-USERNAME --password ENTER-YOUR-PASSWORD .\gitlab-runner.exe start ``` -------------------------------- ### Clone OpenTelemetry Demo Repository Source: https://docs.gitlab.com/development/observability Clone the OpenTelemetry demo repository to get started with observability setup. ```shell git clone https://github.com/open-telemetry/opentelemetry-demo.git ``` -------------------------------- ### Set up Go Project Source: https://docs.gitlab.com/tutorials/build_runner_admission_controller Initialize a new Go project for the runner admission controller and set up the Go module. ```shell mkdir runner-admission-controller cd runner-admission-controller go mod init example.com/runner-admission-controller ``` -------------------------------- ### Deprecated GitLab database.yml Syntax Example Source: https://docs.gitlab.com/update/versions/gitlab_15_changes Example of a deprecated `config/database.yml` syntax for self-compiled GitLab installations. This syntax will generate an error during application start in GitLab 15.0 and later. ```yaml production: adapter: postgresql encoding: unicode database: gitlabhq_production ... ``` -------------------------------- ### Tutorial Markdown Structure with Guide Shortcode Source: https://docs.gitlab.com/development/documentation/topic_types/tutorial Example of using the 'guide' shortcode for stylized ordered lists within tutorial sections, suitable for complex steps. ```markdown ## Do the first task Briefly explain what we're going to do in this task. {{< guide >}} 1. Do the first thing. Keep this sentence short and always use a period. This is how you do the first thing. Provide navigation steps, additional details, example code, and screenshots here. 1. Do the second thing. This is how you do the second thing. 1. Do the third thing. This is how you do the third thing. {{< /guide >}} ``` -------------------------------- ### Install Go using Installation Package on macOS Source: https://docs.gitlab.com/runner/development Download and install the Go package installer on macOS, then set up yq. ```shell wget https://storage.googleapis.com/golang/go1.26.3.darwin-amd64.pkg open go*-*.pkg export PATH="$(go env GOBIN):$PATH" YQ_BINARY="yq_$(go env GOHOSTOS)_$(go env GOHOSTARCH).tar.gz" wget https://github.com/mikefarah/yq/releases/download/latest/${YQ_BINARY}.tar.gz sudo tar -C /usr/local -xzf ${YQ_BINARY}.tar.gz ``` -------------------------------- ### NGINX Server Context for Smart Card Authentication Source: https://docs.gitlab.com/administration/auth/smartcard Example NGINX server block configured for SSL, client certificate verification, and forwarding the client certificate. This setup is for self-compiled GitLab installations. ```nginx server { listen smartcard.example.com:3443 ssl; # certificate for configuring SSL ssl_certificate /path/to/example.com.crt; ssl_certificate_key /path/to/example.com.key; ssl_verify_depth 2; # CA certificate for client side certificate verification ssl_client_certificate /etc/ssl/certs/CA.pem; ssl_verify_client on; location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header X-SSL-Client-Certificate $ssl_client_escaped_cert; proxy_read_timeout 300; proxy_pass http://gitlab-workhorse; } } ``` -------------------------------- ### Start GitLab Rails Console (Source Installation) Source: https://docs.gitlab.com/administration/feature_flags Command to start the GitLab Rails console for installations from source. ```shell sudo -u git -H bundle exec rails console -e production ``` -------------------------------- ### Setup Development Database with Migrations Source: https://docs.gitlab.com/development/database/database_debugging Resets the database, runs pending migrations, and seeds it with sample data. This is a comprehensive setup command. ```shell bundle exec rake db:setup RAILS_ENV=development ``` -------------------------------- ### Docker Daemon Connection Error (TLS) Source: https://docs.gitlab.com/ci/docker/docker_build_troubleshooting This error occurs with Docker-in-Docker v19.03+ when the daemon starts with TLS automatically. Ensure you are using the correct setup for Docker executor or have followed the upgrade guide if coming from an older version. ```text docker: Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running? ``` -------------------------------- ### Guided Onboarding for Orbit Source: https://docs.gitlab.com/cli/orbit Use this command for guided onboarding to verify access, install the Orbit skill, and install the local CLI. ```bash # Guided onboarding: verify access, install the skill, install the local CLI $ glab orbit setup ``` -------------------------------- ### Quick Start: Setup External Dependencies Source: https://docs.gitlab.com/charts/development/external-dependencies Run this command from the root of the chart repository to set up external dependencies. You can specify a custom namespace using the NAMESPACE variable. ```shell bash scripts/dev_dependencies.sh setup ``` ```shell NAMESPACE=my-namespace bash scripts/dev_dependencies.sh setup ``` -------------------------------- ### Install and Start GitLab Runner Service Source: https://docs.gitlab.com/runner/install/linux-manually Install GitLab Runner as a system service and start it. The runner will execute jobs as the specified user. ```shell sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner ``` ```shell sudo gitlab-runner start ``` -------------------------------- ### Run Instance Setup Script Source: https://docs.gitlab.com/charts/backup-restore/restore Execute the instance setup script within the Toolbox pod to enable Kubernetes-specific features like incremental CI job logging after a restore. ```shell kubectl exec -it -- gitlab-rails runner -e production /scripts/custom-instance-setup ``` -------------------------------- ### Install and Start GitLab Runner Service on Windows Source: https://docs.gitlab.com/runner/install/windows Commands to install the GitLab Runner service using a specified password and then attempt to start it. This is often followed by troubleshooting steps if the service fails to start. ```shell gitlab-runner install --password WINDOWS_MACHINE_PASSWORD gitlab-runner start FATA[0000] Failed to start GitLab Runner: The service did not start due to a logon failure. ``` -------------------------------- ### Cost Format in EXPLAIN Plans Source: https://docs.gitlab.com/development/database/understanding_explain_plans Illustrates the format for startup and total costs in EXPLAIN plans. ```sql STARTUP COST..TOTAL COST ``` -------------------------------- ### Install Dependencies and Prepare Environment Source: https://docs.gitlab.com/ci/examples/deployment/composer-npm-deploy Install necessary packages like zip/unzip, and set up Composer for PHP dependency management. This script runs before the main build steps. ```yaml before_script: - apt-get update - apt-get install zip unzip - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - php composer-setup.php - php -r "unlink('composer-setup.php');" ``` -------------------------------- ### Start Sidekiq for Source Installation (systemd) Source: https://docs.gitlab.com/administration/cicd/job_logs Start the GitLab sidekiq service using systemd for source installations to resume CI data processing. ```shell # For systems running systemd sudo systemctl start gitlab-sidekiq ``` -------------------------------- ### Prepare GitLab Runner Directory and Install Source: https://docs.gitlab.com/runner/configuration/runner_autoscale_aws_fargate Create necessary directories for GitLab Runner, set up the repository, and install the gitlab-runner package. ```shell sudo mkdir -p /opt/gitlab-runner/{metadata,builds,cache} curl -s "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash sudo apt install gitlab-runner ``` -------------------------------- ### Start Sidekiq for Source Installation (SysV init) Source: https://docs.gitlab.com/administration/cicd/job_logs Start the GitLab service using SysV init for source installations to resume CI data processing. ```shell # For systems running SysV init sudo service gitlab start ``` -------------------------------- ### Example: Database Migrations Instructions Source: https://docs.gitlab.com/user/duo_agent_platform/customize/review_instructions Custom review instructions for database migration files, referencing external guidelines and checklists. ```yaml instructions: - name: Database Migrations fileFilters: - "db/migrate/**/*.rb" - "db/post_migrate/**/*.rb" instructions: | 1. Follow the migration safety guidelines in https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/development/database/avoiding_downtime_in_migrations.md 2. Apply the team checklist in docs/migrations-checklist.md ``` -------------------------------- ### Install Maven Package with dependency:get Source: https://docs.gitlab.com/ee/user/packages/maven_repository Use the 'mvn dependency:get' command for direct installation, specifying the artifact, remote repositories, and settings file. ```shell mvn dependency:get -Dartifact=com.nickkipling.app:nick-test-app:1.1-SNAPSHOT -DremoteRepositories=gitlab-maven:::: -s ``` -------------------------------- ### Example: All Files Instructions Source: https://docs.gitlab.com/user/duo_agent_platform/customize/review_instructions A catch-all instruction set that applies to every file in the repository. ```yaml instructions: - name: All Files fileFilters: - "**/*" # All files in the repository instructions: | 1. Explain the "why" behind each suggestion ``` -------------------------------- ### Configure Kubernetes Executor with Container Lifecycle Hooks Source: https://docs.gitlab.com/runner/executors/kubernetes/index Example TOML configuration for the Kubernetes executor, demonstrating the setup of PreStop and PostStart container lifecycle hooks. Includes an exec command for PostStart and an HTTP GET request for PreStop with custom headers. ```toml [[runners]] name = "kubernetes" url = "https://gitlab.example.com/" executor = "kubernetes" token = "yrnZW46BrtBFqM7xDzE7dddd" [runners.kubernetes] image = "alpine:3.11" privileged = true namespace = "default" [runners.kubernetes.container_lifecycle.post_start.exec] command = ["touch", "/builds/postStart.txt"] [runners.kubernetes.container_lifecycle.pre_stop.http_get] port = 8080 host = "localhost" path = "/test" [[runners.kubernetes.container_lifecycle.pre_stop.http_get.http_headers]] name = "header_name_1" value = "header_value_1" [[runners.kubernetes.container_lifecycle.pre_stop.http_get.http_headers]] name = "header_name_2" value = "header_value_2" ``` -------------------------------- ### Setup Release Tools Repository Source: https://docs.gitlab.com/charts/development/release Clone the release-tools repository and install its dependencies to prepare for manual Helm chart releases. ```shell git clone git@gitlab.com:gitlab-org/release-tools.git bundle install ``` -------------------------------- ### Install Docker on Ubuntu/Debian Source: https://docs.gitlab.com/operations/observability/setup_self_managed Installs Docker and Docker Compose, enables and starts the Docker service, and adds the current user to the docker group. ```shell sudo apt update sudo apt install -y docker.io docker-compose sudo systemctl enable docker sudo systemctl start docker sudo usermod -aG docker $(whoami) ``` -------------------------------- ### Install Missing Dependencies Source: https://docs.gitlab.com/user/application_security/api_security/api_discovery If the container image is missing a dependency, install it using a 'before_script'. This example installs 'curl'. ```yaml api_discovery: extends: .api_discovery_java_spring_boot image: eclipse-temurin:17-jre-alpine variables: API_DISCOVERY_JAVA_CLASSPATH: build/libs/spring-boot-app-0.0.0.jar before_script: - apk add --no-cache curl ``` -------------------------------- ### Complete Go CI/CD Pipeline Example Source: https://docs.gitlab.com/ci/components/examples A full CI/CD pipeline template for Go projects, including test, build, and deploy stages. ```yaml default: image: golang:latest stages: - test - build - deploy format: stage: test script: - go fmt $(go list ./... | grep -v /vendor/) - go vet $(go list ./... | grep -v /vendor/) - go test -race $(go list ./... | grep -v /vendor/) compile: stage: build script: - mkdir -p mybinaries - go build -o mybinaries ./... artifacts: paths: - mybinaries ``` -------------------------------- ### Start Courier IMAP service Source: https://docs.gitlab.com/administration/reply_by_email_postfix_setup Starts the Courier IMAP daemon after installation. ```shell imapd start ``` -------------------------------- ### Jenkinsfile Example Source: https://docs.gitlab.com/ci/migration/jenkins A basic Jenkinsfile demonstrating a simple pipeline with a 'hello' stage and echo step. ```groovy pipeline { agent any stages { stage('hello') { steps { echo "Hello World" } } } } ``` -------------------------------- ### Docker Setup: Start Containerized GitLab Instance Source: https://docs.gitlab.com/development/data_seeder Starts a containerized GitLab instance using local files. Mounts necessary directories for the data seeder and specs. ```shell docker run \ -d \ -p 8080:80 \ --name gitlab \ -v ./scripts/data_seeder:/opt/gitlab/embedded/service/gitlab-rails/scripts/data_seeder \ -v ./ee/db/seeds/data_seeder:/opt/gitlab/embedded/service/gitlab-rails/ee/db/seeds/data_seeder \ -v ./ee/lib/tasks/gitlab/seed:/opt/gitlab/embedded/service/gitlab-rails/ee/lib/tasks/gitlab/seed \ -v ./spec:/opt/gitlab/embedded/service/gitlab-rails/spec \ -v ./ee/spec:/opt/gitlab/embedded/service/gitlab-rails/ee/spec \ gitlab/gitlab-ee:16.9.8-ee.0 ``` -------------------------------- ### Yarn Install Dockerfile Error Example Source: https://docs.gitlab.com/user/packages/yarn_repository This is an example of the error message you might encounter when `yarn install` fails to clone a repository due to SSL certificate problems in a Docker build. ```text ... fatal: unable to access 'https://gitlab.com/path/to/project/': Problem with the SSL CA cert (path? access rights?) info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. ... ``` -------------------------------- ### Operation Description Examples Source: https://docs.gitlab.com/development/documentation/restful_api_styleguide Examples of operation descriptions that start by repeating the operation title. ```text Lists all project access tokens. ``` ```text Deletes an SSH key from your user account. ``` ```text Retrieves details on a specified enterprise user. ``` -------------------------------- ### Tutorial Metadata Example Source: https://docs.gitlab.com/development/documentation/topic_types/tutorial Example of stage and group metadata for tutorial pages, specifying 'Tutorials' for both when content spans multiple groups. ```yaml stage: Tutorials group: Tutorials ``` -------------------------------- ### Set up Asana Source: https://docs.gitlab.com/api/project_integrations Set up the Asana integration for a project. ```APIDOC ## PUT /projects/:id/integrations/asana ### Description Set up the Asana integration for a project. ### Method PUT ### Endpoint /projects/:id/integrations/asana ### Parameters #### Request Body - **api_key** (string) - Required - User API token. The user must have access to the task. All comments are attributed to this user. - **restrict_to_branch** (string) - Optional - Comma-separated list of branches to be automatically inspected. Leave blank to include all branches. - **use_inherited_settings** (boolean) - Optional - Indicates whether to inherit the default settings. Defaults to `false`. ``` -------------------------------- ### Example: Install Package from GitLab NuGet v2 Feed Source: https://docs.gitlab.com/ee/user/packages/nuget_repository Example of installing a package using the GitLab NuGet v2 feed. You can use the source name 'gitlab' or the full URL with authentication. ```shell choco install MyPackage -Source gitlab -Version 1.0.2 # or choco install MyPackage -Source "https://gitlab.example.com/api/v4/projects//packages/nuget/v2" -u -p -Version 1.0.2 ``` -------------------------------- ### Install Gitaly Source: https://docs.gitlab.com/install/self_compiled Fetches Gitaly source, compiles it with Go, and sets up the repository data directory with restricted access. ```shell # Create and restrict access to the git repository data directory sudo install -d -o git -m 0700 /home/git/repositories # Fetch Gitaly source with Git and compile with Go cd /home/git/gitlab sudo -u git -H bundle exec rake "gitlab:gitaly:install[/home/git/gitaly,/home/git/repositories]" RAILS_ENV=production ``` -------------------------------- ### Install Recommended Developer Tools with Mise Source: https://docs.gitlab.com/charts/development/environment_setup Use 'mise' to trust and install all specified developer tools and their versions from the .tool-versions file. ```shell mise trust mise install ``` -------------------------------- ### Linux Package Setup: Install Test Resources Source: https://docs.gitlab.com/development/data_seeder Installs test resources by sourcing a shell script within the GitLab installation directory. ```shell . scripts/data_seeder/test_resources.sh ``` -------------------------------- ### Example Workflow Response Source: https://docs.gitlab.com/api/duo_agent_platform_flows This is an example of a successful response when starting a Duo Agent Platform workflow. ```json { "id": 1, "project_id": 5, "namespace_id": null, "agent_privileges": [1, 2, 3, 4, 5, 6], "agent_privileges_names": [ "read_write_files", "read_only_gitlab", "read_write_gitlab", "run_commands", "use_git", "run_mcp_tools" ], "pre_approved_agent_privileges": [], "pre_approved_agent_privileges_names": [], "workflow_definition": "developer/v1", "status": "running", "allow_agent_to_request_user": true, "image": null, "environment": null, "ai_catalog_item_version_id": null, "workload": { "id": "abc-123", "message": "Workflow started" }, "mcp_enabled": false, "gitlab_url": "https://gitlab.example.com" } ``` -------------------------------- ### Run Development Setup Source: https://docs.gitlab.com/runner/development Execute the command to set up the development environment for GitLab Runner. ```shell make development_setup ``` -------------------------------- ### Get Helm Installation Status Source: https://docs.gitlab.com/charts/troubleshooting/kubernetes_cheat_sheet Displays the current status of a GitLab installation managed by Helm. ```shell helm status ```