### Maven Version Output Example Source: https://docs.gitlab.com/18.4/user/packages/workflows/build_packages Example output showing the installed Maven version and environment details. ```shell Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T20:00:29+01:00) Maven home: /Users//apache-maven-3.6.1 Java version: 12.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home Default locale: en_GB, platform encoding: UTF-8 OS name: "mac os x", version: "10.15.2", arch: "x86_64", family: "mac" ``` -------------------------------- ### Gradle Version Output Example Source: https://docs.gitlab.com/18.4/user/packages/workflows/build_packages Example output showing the installed Gradle version and environment details. ```shell ------------------------------------------------------------ Gradle 6.0.1 ------------------------------------------------------------ Build time: 2019-11-18 20:25:01 UTC Revision: fad121066a68c4701acd362daf4287a7c309a0f5 Kotlin: 1.3.50 Groovy: 2.5.8 Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019 JVM: 11.0.5 (Oracle Corporation 11.0.5+10) OS: Windows 10 10.0 amd64 ``` -------------------------------- ### sbt Version Output Example Source: https://docs.gitlab.com/18.4/user/packages/workflows/build_packages Example output showing the installed sbt version. ```shell [warn] Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? (default: r) sbt script version: 1.9.8 ``` -------------------------------- ### Install and start service Source: https://docs.gitlab.com/18.4/runner/install/osx Installs and starts the GitLab Runner as a service in the current user context. ```shell cd ~ gitlab-runner install gitlab-runner start ``` -------------------------------- ### Install and Start GitLab Runner Service on Windows Source: https://docs.gitlab.com/18.4/runner/install/windows Demonstrates the commands to install and start the GitLab Runner service on Windows. This snippet is often followed by a 'logon failure' error if permissions are not correctly set. ```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. ``` -------------------------------- ### Install and Start GitLab Runner (System Account) Source: https://docs.gitlab.com/18.4/runner/install/windows Installs and starts the GitLab Runner service using the Built-in System Account. Ensure you are in the GitLab Runner directory. ```powershell cd C:\GitLab-Runner ./gitlab-runner.exe install ./gitlab-runner.exe start ``` -------------------------------- ### Markdown template for Get started pages Source: https://docs.gitlab.com/18.4/development/documentation/topic_types/get_started Standard structure for Get started documentation pages, including front matter, workflow description, and step-based organization. ```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). ``` -------------------------------- ### Example Custom Instructions for Ruby Source: https://docs.gitlab.com/18.4/user/project/merge_requests/duo_in_merge_requests Example of custom instructions for Ruby files, enforcing style guide conventions and documentation. ```yaml instructions: - name: Ruby Style Guide fileFilters: - "*.rb" - "lib/**/*.rb" - "!spec/**/*.rb" # Exclude test files instructions: | 1. Ensure all methods have proper documentation 2. Follow Ruby style guide conventions 3. Prefer symbols over strings for hash keys ``` -------------------------------- ### Start GitLab Services for Source Installation Source: https://docs.gitlab.com/18.4/administration/cicd/job_logs Resume Sidekiq services after configuration changes. ```shell # For systems running systemd sudo systemctl start gitlab-sidekiq # For systems running SysV init sudo service gitlab start ``` -------------------------------- ### PostgreSQL Extension Installation Failure Example Source: https://docs.gitlab.com/18.4/install/postgresql_extensions This output shows a typical error when a PostgreSQL extension like 'btree_gist' has not been installed before GitLab attempts to use it during its setup or upgrade process. It indicates a permission issue, requiring superuser privileges. ```shell ---- Begin output of "bash" "/tmp/chef-script20210513-52940-d9b1gs" ---- STDOUT: psql:/opt/gitlab/embedded/service/gitlab-rails/db/structure.sql:9: ERROR: permission denied to create extension "btree_gist" HINT: Must be superuser to create this extension. rake aborted! failed to execute: psql -v ON_ERROR_STOP=1 -q -X -f /opt/gitlab/embedded/service/gitlab-rails/db/structure.sql --single-transaction gitlabhq_production ``` -------------------------------- ### Setup.py Review Prompt Source: https://docs.gitlab.com/18.4/user/gitlab_duo/tutorials/fix_code_python_shop Prompt to ask Chat for advice on refining the generated setup.py file. ```text You have used Code Suggestions to generate a Python configuration file, `setup.py`, for a Flask web application. This file includes dependencies for Flask, testing, and database functionality. If I were to review this file, what might I want to change and adjust? ``` -------------------------------- ### Complete Apache HTTP Server Setup Source: https://docs.gitlab.com/18.4/omnibus/troubleshooting Removes the default welcome page, creates the repository directory, and enables/starts the Apache HTTP server service. ```shell sudo rm -f /etc/httpd/conf.d/welcome.conf sudo mkdir /var/www/html/repos sudo systemctl enable httpd --now ``` -------------------------------- ### Basic Runner Configuration Example Source: https://docs.gitlab.com/18.4/runner/configuration/advanced-configuration Defines a single GitLab runner with essential parameters like name, URL, token, executor, and environment variables. Use this as a starting point for your runner setup. ```toml [[runners]] name = "example-runner" url = "http://gitlab.example.com/" token = "TOKEN" limit = 0 executor = "docker" builds_dir = "" shell = "" environment = ["ENV=value", "LC_ALL=en_US.UTF-8"] clone_url = "http://gitlab.example.local" ``` -------------------------------- ### Copy example project file Source: https://docs.gitlab.com/18.4/omnibus/development/new-software-definition Copy the 'simple.rb' example file to the 'config/projects/' directory to set up a project for testing a single software dependency. ```shell cp doc/development/examples/simple.rb config/projects/ ``` -------------------------------- ### Start Project Best Practices Prompt Source: https://docs.gitlab.com/18.4/user/gitlab_duo_chat/best_practices Begin with a general question to initiate a topic, then follow up with more specific queries to refine the scope and gather detailed information. ```text c# start project best practices ``` ```text Please show the project structure for the C# project. ``` -------------------------------- ### Install and Start Jenkins on macOS Source: https://docs.gitlab.com/18.4/development/integrations/jenkins Use Homebrew to install the Jenkins package and start the background service. ```shell brew install jenkins brew services start jenkins ``` -------------------------------- ### Start Rails Console Source: https://docs.gitlab.com/18.4/administration/wikis Use this command to start the Rails console for Omnibus installations or installations from source. ```shell # For Omnibus installations sudo gitlab-rails console ``` ```shell # For installations from source sudo -u git -H bundle exec rails console -e production ``` -------------------------------- ### Comprehensive C# Project Setup Prompt Source: https://docs.gitlab.com/18.4/user/gitlab_duo_chat/best_practices Provide a detailed prompt that includes the initial setup, configuration files like .gitignore and .gitlab-ci.yml, and security scanning requirements for a C# project. ```text How can I get started creating an empty C# console application in VS Code? Please show a .gitignore and .gitlab-ci.yml configuration with steps for C#, and add security scanning for GitLab. ``` -------------------------------- ### Setup Release Tools Repository Source: https://docs.gitlab.com/18.4/charts/development/release Clone and prepare the release-tools repository for manual release tasks. ```shell git clone git@gitlab.com:gitlab-org/release-tools.git bundle install ``` -------------------------------- ### Install Courier IMAP server Source: https://docs.gitlab.com/18.4/administration/reply_by_email_postfix_setup Install the Courier IMAP server package and start the 'imapd' service. Ensure 'courier-authdaemon' is also started and enabled to start on boot. ```shell sudo apt-get install courier-imap imapd start sudo service courier-authdaemon start sudo systemctl enable courier-authdaemon ``` -------------------------------- ### Install Dependencies and Run Migrations Source: https://docs.gitlab.com/18.4/update/patch_versions Install necessary gems, clean up old gems, run database migrations, and compile assets. Ensure `deployment` is set to `true` and `development test kerberos` are excluded from bundle install if not needed. ```shell cd /home/git/gitlab # If you haven't done so during installation or a previous upgrade already sudo -u git -H bundle config set --local deployment 'true' sudo -u git -H bundle config set --local without 'development test kerberos' # Update gems sudo -u git -H bundle install # Optional: clean up old gems sudo -u git -H bundle clean # Run database migrations sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production # Clean up assets and cache sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile cache:clear RAILS_ENV=production NODE_ENV=production NODE_OPTIONS="--max_old_space_size=4096" ``` -------------------------------- ### Install curl for repository setup Source: https://docs.gitlab.com/18.4/install/package/amazonlinux_2 Installs the curl package, which is required for downloading and executing the GitLab repository setup script. ```shell sudo yum install -y curl ``` -------------------------------- ### Install and Start GitLab Runner Service Source: https://docs.gitlab.com/18.4/runner/install/linux-manually Install the 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 sudo gitlab-runner start ``` -------------------------------- ### Create a Go Hello World file Source: https://docs.gitlab.com/18.4/tutorials/scan_execution_policy A basic Go program used to initialize the project repository. ```go package main import "fmt" func main() { fmt.Println("Hello world") } ``` -------------------------------- ### Start GitLab Rails console (Source installation) Source: https://docs.gitlab.com/18.4/administration/feature_flags Use this command to start a Rails console session for installations from source in a production environment. ```shell sudo -u git -H bundle exec rails console -e production ``` -------------------------------- ### Setup Praefect SSL directory and permissions Source: https://docs.gitlab.com/18.4/administration/gitaly/praefect/configure Create the SSL directory and set appropriate permissions for certificate files. ```shell sudo mkdir -p /etc/gitlab/ssl sudo chmod 755 /etc/gitlab/ssl sudo cp key.pem cert.pem /etc/gitlab/ssl/ sudo chmod 644 key.pem cert.pem ``` -------------------------------- ### Start the build container Source: https://docs.gitlab.com/18.4/omnibus/build/build_package Launch the build container with the source directory mounted for development. ```shell docker run -v ~/omnibus-gitlab:/omnibus-gitlab -it registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/debian_10:${BUILDER_IMAGE_REVISION} bash ``` -------------------------------- ### Follow-up on C# Project Setup Source: https://docs.gitlab.com/18.4/user/gitlab_duo_chat/examples Ask how to add .gitignore and .gitlab-ci.yml files for a C# project. ```C# Can you also explain how to add a .gitignore and .gitlab-ci.yml file for C#? ``` -------------------------------- ### Initialize GDK environment Source: https://docs.gitlab.com/18.4/development/data_seeder Starts required services and prepares the database for seeding. ```shell $ gdk start db ok: run: services/postgresql: (pid n) 0s, normally down ok: run: services/redis: (pid n) 74s, normally down $ bundle install Bundle complete! $ bundle exec rake db:migrate main: migrated ci: migrated ``` -------------------------------- ### Install Maven Package with Dependency Get Source: https://docs.gitlab.com/18.4/user/packages/maven_repository Use the `mvn dependency:get` command for direct installation of a Maven package. Ensure the artifact coordinates and remote repository URL are correct, and the path to `settings.xml` is provided. ```shell mvn dependency:get -Dartifact=com.nickkipling.app:nick-test-app:1.1-SNAPSHOT -DremoteRepositories=gitlab-maven:::: -s ``` -------------------------------- ### Recommended Step Example Source: https://docs.gitlab.com/18.4/development/documentation/styleguide Demonstrates how to format a recommended step in documentation. ```markdown 1. Recommended. Enter a description for the job. ``` -------------------------------- ### Install and Start GitLab Runner (User Account) Source: https://docs.gitlab.com/18.4/runner/install/windows Installs and starts the GitLab Runner service using a specified user account. You must provide valid username and password. Ensure you are in the GitLab Runner directory. ```powershell cd C:\GitLab-Runner ./gitlab-runner.exe install --user ENTER-YOUR-USERNAME --password ENTER-YOUR-PASSWORD ./gitlab-runner.exe start ``` -------------------------------- ### Initialize Maven Project Source: https://docs.gitlab.com/18.4/user/packages/workflows/build_packages Generate a new Maven project structure using the quickstart archetype. ```shell mvn archetype:generate -DgroupId=com.mycompany.mydepartment -DartifactId=my-project -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false ``` -------------------------------- ### Example Request to Get Single Project Issue Source: https://docs.gitlab.com/18.4/api/issues This example demonstrates how to make a GET request to the API to fetch a specific issue. Replace `` with your actual token and adjust the project and issue IDs as needed. ```shell curl --header "PRIVATE-TOKEN: " \ --url "https://gitlab.example.com/api/v4/projects/4/issues/41" ``` -------------------------------- ### Start Minikube and Enable Addons Source: https://docs.gitlab.com/18.4/charts/troubleshooting/kubernetes_cheat_sheet Start a minikube instance with specified CPU and memory resources, and enable the ingress addon. This is a minimum configuration required for GitLab. ```shell minikube start --cpus 3 --memory 8192 # minimum amount for GitLab to work minikube addons enable ingress ``` -------------------------------- ### Example PowerShell Build Script Source: https://docs.gitlab.com/18.4/runner/shells A sample script demonstrating environment variable setup, repository cloning, and cache restoration. ```powershell $ErrorActionPreference = "Continue" # This will be set to 'Stop' when targetting PowerShell Core echo "Running on $([Environment]::MachineName)..." & { $CI="true" $env:CI=$CI $CI_COMMIT_SHA="db45ad9af9d7af5e61b829442fd893d96e31250c" $env:CI_COMMIT_SHA=$CI_COMMIT_SHA $CI_COMMIT_BEFORE_SHA="d63117656af6ff57d99e50cc270f854691f335ad" $env:CI_COMMIT_BEFORE_SHA=$CI_COMMIT_BEFORE_SHA $CI_COMMIT_REF_NAME="main" $env:CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME $CI_JOB_ID="1" $env:CI_JOB_ID=$CI_JOB_ID $CI_REPOSITORY_URL="Z:\Gitlab\tests\test" $env:CI_REPOSITORY_URL=$CI_REPOSITORY_URL $CI_PROJECT_ID="1" $env:CI_PROJECT_ID=$CI_PROJECT_ID $CI_PROJECT_DIR="Z:\Gitlab\tests\test\builds\0\project-1" $env:CI_PROJECT_DIR=$CI_PROJECT_DIR $CI_SERVER="yes" $env:CI_SERVER=$CI_SERVER $CI_SERVER_NAME="GitLab CI" $env:CI_SERVER_NAME=$CI_SERVER_NAME $CI_SERVER_VERSION="" $env:CI_SERVER_VERSION=$CI_SERVER_VERSION $CI_SERVER_REVISION="" $env:CI_SERVER_REVISION=$CI_SERVER_REVISION $GITLAB_CI="true" $env:GITLAB_CI=$GITLAB_CI $GIT_SSL_CAINFO="" New-Item -ItemType directory -Force -Path "C:\GitLab-Runner\builds\0\project-1.tmp" | out-null $GIT_SSL_CAINFO | Out-File "C:\GitLab-Runner\builds\0\project-1.tmp\GIT_SSL_CAINFO" $GIT_SSL_CAINFO="C:\GitLab-Runner\builds\0\project-1.tmp\GIT_SSL_CAINFO" $env:GIT_SSL_CAINFO=$GIT_SSL_CAINFO $CI_SERVER_TLS_CA_FILE="" New-Item -ItemType directory -Force -Path "C:\GitLab-Runner\builds\0\project-1.tmp" | out-null $CI_SERVER_TLS_CA_FILE | Out-File "C:\GitLab-Runner\builds\0\project-1.tmp\CI_SERVER_TLS_CA_FILE" $CI_SERVER_TLS_CA_FILE="C:\GitLab-Runner\builds\0\project-1.tmp\CI_SERVER_TLS_CA_FILE" $env:CI_SERVER_TLS_CA_FILE=$CI_SERVER_TLS_CA_FILE echo "Cloning repository..." if( (Get-Command -Name Remove-Item2 -Module NTFSSecurity -ErrorAction SilentlyContinue) -and (Test-Path "C:\GitLab-Runner\builds\0\project-1" -PathType Container) ) { Remove-Item2 -Force -Recurse "C:\GitLab-Runner\builds\0\project-1" } elseif(Test-Path "C:\GitLab-Runner\builds\0\project-1") { Remove-Item -Force -Recurse "C:\GitLab-Runner\builds\0\project-1" } & "git" "clone" "https://gitlab.com/group/project.git" "Z:\Gitlab\tests\test\builds\0\project-1" if(!$?) { Exit $LASTEXITCODE } cd "C:\GitLab-Runner\builds\0\project-1" if(!$?) { Exit $LASTEXITCODE } echo "Checking out db45ad9a as main..." & "git" "checkout" "db45ad9af9d7af5e61b829442fd893d96e31250c" if(!$?) { Exit $LASTEXITCODE } if(Test-Path "..\..\..\cache\project-1\pages\main\cache.tgz" -PathType Leaf) { echo "Restoring cache..." & "gitlab-runner-windows-amd64.exe" "extract" "--file" "..\..\..\cache\project-1\pages\main\cache.tgz" if(!$?) { Exit $LASTEXITCODE } } else { if(Test-Path "..\..\..\cache\project-1\pages\main\cache.tgz" -PathType Leaf) { echo "Restoring cache..." & "gitlab-runner-windows-amd64.exe" "extract" "--file" "..\..\..\cache\project-1\pages\main\cache.tgz" if(!$?) { Exit $LASTEXITCODE } } } } if(!$?) { Exit $LASTEXITCODE } & { $CI="true" $env:CI=$CI $CI_COMMIT_SHA="db45ad9af9d7af5e61b829442fd893d96e31250c" $env:CI_COMMIT_SHA=$CI_COMMIT_SHA $CI_COMMIT_BEFORE_SHA="d63117656af6ff57d99e50cc270f854691f335ad" $env:CI_COMMIT_BEFORE_SHA=$CI_COMMIT_BEFORE_SHA $CI_COMMIT_REF_NAME="main" $env:CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME $CI_JOB_ID="1" $env:CI_JOB_ID=$CI_JOB_ID $CI_REPOSITORY_URL="Z:\Gitlab\tests\test" $env:CI_REPOSITORY_URL=$CI_REPOSITORY_URL $CI_PROJECT_ID="1" $env:CI_PROJECT_ID=$CI_PROJECT_ID $CI_PROJECT_DIR="Z:\Gitlab\tests\test\builds\0\project-1" $env:CI_PROJECT_DIR=$CI_PROJECT_DIR $CI_SERVER="yes" $env:CI_SERVER=$CI_SERVER $CI_SERVER_NAME="GitLab CI" $env:CI_SERVER_NAME=$CI_SERVER_NAME $CI_SERVER_VERSION="" $env:CI_SERVER_VERSION=$CI_SERVER_VERSION $CI_SERVER_REVISION="" $env:CI_SERVER_REVISION=$CI_SERVER_REVISION $GITLAB_CI="true" $env:GITLAB_CI=$GITLAB_CI $GIT_SSL_CAINFO="" New-Item -ItemType directory -Force -Path "C:\GitLab-Runner\builds\0\project-1.tmp" | out-null $GIT_SSL_CAINFO | Out-File "C:\GitLab-Runner\builds\0\project-1.tmp\GIT_SSL_CAINFO" ``` -------------------------------- ### Example Response for Getting a Protected Tag Source: https://docs.gitlab.com/18.4/api/protected_tags An example JSON response when retrieving details for a specific protected tag. ```json { "name": "release-1-0", "create_access_levels": [ { "id": 1, "access_level": 40, "access_level_description": "Maintainers" } ] } ``` -------------------------------- ### Install dependencies and prepare environment Source: https://docs.gitlab.com/18.4/ci/examples/deployment/composer-npm-deploy Install necessary packages like zip/unzip and set up Composer within the `before_script` section of your CI/CD configuration. ```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');" ``` -------------------------------- ### Get enterprise user details request Source: https://docs.gitlab.com/18.4/api/group_enterprise_users Example cURL request to get details for a specific enterprise user. ```shell curl --header "PRIVATE-TOKEN: " "https://gitlab.example.com/api/v4/groups/:id/enterprise_users/:user_id" ``` -------------------------------- ### Configure Gmail for Linux Package Installations Source: https://docs.gitlab.com/18.4/administration/incoming_email Example configuration for using Gmail with GitLab Linux package installations. ```ruby gitlab_rails['incoming_email_enabled'] = true # The email address including the %{key} placeholder that will be replaced to reference the # item being replied to. This %{key} should be included in its entirety within the email # address and not replaced by another value. # For example: emailaddress+%{key}@gmail.com. # The placeholder must appear in the "user" part of the address (before the `@`). gitlab_rails['incoming_email_address'] = "gitlab-incoming+%{key}@gmail.com" # Email account username # With third party providers, this is usually the full email address. # With self-hosted email servers, this is usually the user part of the email address. gitlab_rails['incoming_email_email'] = "gitlab-incoming@gmail.com" # Email account password gitlab_rails['incoming_email_password'] = "[REDACTED]" # IMAP server host gitlab_rails['incoming_email_host'] = "imap.gmail.com" # IMAP server port gitlab_rails['incoming_email_port'] = 993 # Whether the IMAP server uses SSL gitlab_rails['incoming_email_ssl'] = true # Whether the IMAP server uses StartTLS gitlab_rails['incoming_email_start_tls'] = false # The mailbox where incoming mail will end up. Usually "inbox". gitlab_rails['incoming_email_mailbox_name'] = "inbox" # The IDLE command timeout. gitlab_rails['incoming_email_idle_timeout'] = 60 # If you are using Microsoft Graph instead of IMAP, set this to false if you want to retain # messages in the inbox because deleted messages are auto-expunged after some time. gitlab_rails['incoming_email_delete_after_delivery'] = true # Whether to expunge (permanently remove) messages from the mailbox when they are marked as deleted after delivery ``` -------------------------------- ### Install FreeBSD Dependencies and Go Runtime Source: https://docs.gitlab.com/18.4/runner/development Installs Go, gmake, git, and mercurial using `pkg`, then downloads and installs yq, and sets up the PATH. ```shell pkg install go-1.24.4 gmake git mercurial 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 ``` -------------------------------- ### Example `config.toml` with Global Settings Source: https://docs.gitlab.com/18.4/runner/configuration/advanced-configuration This example demonstrates a `config.toml` file with global settings for concurrency, log level, log format, and check interval, along with multiple runner configurations. ```toml # Example `config.toml` file concurrent = 100 log_level = "warning" log_format = "text" check_interval = 3 [[runners]] name = "first" url = "Your Gitlab instance URL (for example, `https://gitlab.com`)" executor = "shell" (...) [[runners]] name = "second" url = "Your Gitlab instance URL (for example, `https://gitlab.com`)" executor = "docker" (...) [[runners]] name = "third" url = "Your Gitlab instance URL (for example, `https://gitlab.com`)" executor = "docker-autoscaler" (...) ``` -------------------------------- ### Get Installed ClusterServiceVersion Source: https://docs.gitlab.com/18.4/runner/install/operator Retrieve the details of the installed ClusterServiceVersion (CSV) in the `operators` namespace to identify the CSV name for deletion. ```shell kubectl get clusterserviceversion -n operators NAME DISPLAY VERSION REPLACES PHASE gitlab-runner-operator.v1.7.0 GitLab Runner 1.7.0 Succeeded ``` -------------------------------- ### Kernel Parameter Configuration Example Source: https://docs.gitlab.com/18.4/omnibus/troubleshooting Example of kernel parameter settings to be added to /etc/sysctl.conf. ```text kernel.shmall = 4194304 kernel.sem = 250 32000 32 262 net.core.somaxconn = 2048 kernel.shmmax = 17179869184 ``` -------------------------------- ### Get Single Group Label Response Example Source: https://docs.gitlab.com/18.4/api/group_labels Example JSON response for a single group label, showing its properties. ```json { "id": 7, "name": "bug", "color": "#FF0000", "text_color" : "#FFFFFF", "description": null, "description_html": null, "open_issues_count": 0, "closed_issues_count": 0, "open_merge_requests_count": 0, "subscribed": false, "archived": false } ``` -------------------------------- ### Get single issue label event request Source: https://docs.gitlab.com/18.4/api/resource_label_events Example cURL request to get a single issue label event. ```shell curl --header "PRIVATE-TOKEN: " \ --url "https://gitlab.example.com/api/v4/projects/5/issues/11/resource_label_events/1" ``` -------------------------------- ### Setup KinD Cluster and Deploy Operator Source: https://docs.gitlab.com/18.4/operator/developer/test_olm Execute this script to set up the KinD cluster and deploy the Operator. This is the first step in the testing process. ```shell scripts/test_olm.sh upgrade_test_step1 ``` -------------------------------- ### Install curl for repository setup Source: https://docs.gitlab.com/18.4/install/package/almalinux Installs the curl package, which is required to download the script for adding the GitLab package repository. ```shell sudo dnf install -y curl ``` -------------------------------- ### Example Response for List Project Deploy Keys Source: https://docs.gitlab.com/18.4/api/deploy_keys This is an example of the JSON response when listing deploy keys for a project, showing details for each key. ```json [ { "id": 1, "title": "Public key", "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDNJAkI3Wdf0r13c8a5pEExB2YowPWCSVzfZV22pNBc1CuEbyYLHpUyaD0GwpGvFdx2aP7lMEk35k6Rz3ccBF6jRaVJyhsn5VNnW92PMpBJ/P1UebhXwsFHdQf5rTt082cSxWuk61kGWRQtk4ozt/J2DF/dIUVaLvc+z4HomT41fQ==", "fingerprint": "4a:9d:64:15:ed:3a:e6:07:6e:89:36:b3:3b:03:05:d9", "fingerprint_sha256": "SHA256:Jrs3LD1Ji30xNLtTVf9NDCj7kkBgPBb2pjvTZ3HfIgU", "created_at": "2013-10-02T10:12:29Z", "expires_at": null, "can_push": false }, { "id": 3, "title": "Another Public key", "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDIJFwIL6YNcCgVBLTHgM6hzmoL5vf0ThDKQMWT3HrwCjUCGPwR63vBwn6+/Gx+kx+VTo9FuojzR0O4XfwD3LrYA+oT3ETbn9U4e/VS4AH/G4SDMzgSLwu0YuPe517FfGWhWGQhjiXphkaQ+6bXPmcASWb0RCO5+pYlGIfxv4eFGQ==", "fingerprint": "0b:cf:58:40:b9:23:96:c7:ba:44:df:0e:9e:87:5e:75", "": "SHA256:lGI/Ys/Wx7PfMhUO1iuBH92JQKYN+3mhJZvWO4Q5ims", "created_at": "2013-10-02T11:12:29Z", "expires_at": null, "can_push": false } ] ``` -------------------------------- ### Initialize a Composer project Source: https://docs.gitlab.com/18.4/user/packages/workflows/build_packages Create a directory and initialize a new Composer project. ```shell mkdir my-composer-package && cd my-composer-package ``` -------------------------------- ### Example Response for List Common Project Deploy Keys (with expiration) Source: https://docs.gitlab.com/18.4/api/deploy_keys This example response shows common project deploy keys, including a key with an expiration date set. ```json [ { "id": 1, "title": "Key A", "created_at": "2022-05-30T12:28:27.855Z", "expires_at": "2022-10-30T12:28:27.855Z", "key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILkYXU2fVeO4/0rDCSsswP5iIX2+B6tv15YT3KObgyDl Key", "fingerprint": "40:8e:fa:df:70:f7:a7:06:1e:0d:6f:ae:f2:27:92:01", "fingerprint_sha256": "SHA256:Ojq2LZW43BFK/AMP81jBkDGn9YpPWYRNcViKBB44LPU" } ] ``` -------------------------------- ### Install Missing Dependencies with before_script Source: https://docs.gitlab.com/18.4/user/application_security/api_security/api_discovery If the container image lacks necessary dependencies like 'curl', install them using a 'before_script' section. This example uses 'apt' to install '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 ``` -------------------------------- ### Create a Google Cloud project Source: https://docs.gitlab.com/18.4/tutorials/create_gitlab_pipeline_push_to_google_artifact_registry Initializes a new project in Google Cloud. ```shell gcloud projects create PROJECT_ID ``` -------------------------------- ### Start GitLab Rails console (Linux package) Source: https://docs.gitlab.com/18.4/administration/feature_flags Use this command to start a Rails console session on Linux package installations. ```shell sudo gitlab-rails console ``` -------------------------------- ### View Multiple Steps Output Example Source: https://docs.gitlab.com/18.4/tutorials/setup_steps Example output from a successful pipeline run with multiple steps, showing outputs from both steps. ```shell Step Runner version: a7c7c8fd See https://gitlab.com/gitlab-org/step-runner/-/blob/main/CHANGELOG.md for changes. ... hello world hello gitlab steps Cleaning up project directory and file based variables Job succeeded ``` -------------------------------- ### Example production_json.log entry for a GET request Source: https://docs.gitlab.com/18.4/administration/logs A standard log entry representing a successful GET request to a project issues controller. ```json { "method":"GET", "path":"/gitlab/gitlab-foss/issues/1234", "format":"html", "controller":"Projects::IssuesController", "action":"show", "status":200, "time":"2017-08-08T20:15:54.821Z", "params":[{"key":"param_key","value":"param_value"}], "remote_ip":"18.245.0.1", "user_id":1, "username":"admin", "queue_duration_s":0.0, "gitaly_calls":16, "gitaly_duration_s":0.16, "redis_calls":115, "redis_duration_s":0.13, "redis_read_bytes":1507378, "redis_write_bytes":2920, "correlation_id":"O1SdybnnIq7", "cpu_s":17.50, "db_duration_s":0.08, "view_duration_s":2.39, "duration_s":20.54, "pid": 81836, "worker_id":"puma_0" } ``` -------------------------------- ### Install macOS Dependencies using Installation Package Source: https://docs.gitlab.com/18.4/runner/development Installs Go using its official package and yq by downloading binaries, then sets up the PATH. ```shell wget https://storage.googleapis.com/golang/go1.24.6.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 ``` -------------------------------- ### Kubectl Command Example Source: https://docs.gitlab.com/18.4/user/clusters/agent/ci_cd_workflow This is an example of a basic `kubectl get pods` command. If TLS is not properly configured or if there are authentication issues, this command might fail. ```shell $ kubectl get pods ``` -------------------------------- ### Example Prompt Snippet for Reference Material Source: https://docs.gitlab.com/18.4/development/duo_agent_platform/create_triage_policy_with_gitlab_duo_agent_platform_guide Include a reference to example files to ensure correct syntax for the generated policy. ```text Read instructions and example yml files in policies/one-off/duo-workflow-guide-and-example-policies to ensure the result has the correct syntax. ``` -------------------------------- ### Example Output of Locating Persistent Volume Claims Source: https://docs.gitlab.com/18.4/charts/advanced/persistent-volumes This is an example output showing the volume names and the applications they are associated with, obtained from the `get PersistentVolumeClaims` command. ```shell $ kubectl --namespace helm-charts-win get PersistentVolumeClaims -l release=review-update-app-h8qogp -ojsonpath='{range .items[*]}{.spec.volumeName}{"\t"}{.metadata.labels.app}{"\n"}{end}' pvc-6247502b-8c2d-11e8-8267-42010a9a0113 gitaly pvc-61bbc05e-8c2d-11e8-8267-42010a9a0113 minio pvc-61bc6069-8c2d-11e8-8267-42010a9a0113 postgresql pvc-61bcd6d2-8c2d-11e8-8267-42010a9a0113 prometheus pvc-61bdf136-8c2d-11e8-8267-42010a9a0113 redis ``` -------------------------------- ### View Job Logs Example Source: https://docs.gitlab.com/18.4/tutorials/setup_steps Example output from a successful job execution, showing the 'hello world' output. ```shell Step Runner version: a7c7c8fd See https://gitlab.com/gitlab-org/step-runner/-/blob/main/CHANGELOG.md for changes. ... hello world Cleaning up project directory and file based variables Job succeeded ``` -------------------------------- ### GET v3 NuGet Source Feed Example Response Source: https://docs.gitlab.com/18.4/api/packages/nuget An example JSON response listing the available resources for the v3 NuGet source feed. ```json { "version": "3.0.0", "resources": [ { "@id": "https://gitlab.example.com/api/v4/projects/1/packages/nuget/query", "@type": "SearchQueryService", "comment": "Filter and search for packages by keyword." }, { "@id": "https://gitlab.example.com/api/v4/projects/1/packages/nuget/query", "@type": "SearchQueryService/3.0.0-beta", "comment": "Filter and search for packages by keyword." }, { "@id": "https://gitlab.example.com/api/v4/projects/1/packages/nuget/query", "@type": "SearchQueryService/3.0.0-rc", "comment": "Filter and search for packages by keyword." }, { "@id": "https://gitlab.example.com/api/v4/projects/1/packages/nuget/metadata", "@type": "RegistrationsBaseUrl", "comment": "Get package metadata." }, { "@id": "https://gitlab.example.com/api/v4/projects/1/packages/nuget/metadata", "@type": "RegistrationsBaseUrl/3.0.0-beta", "comment": "Get package metadata." }, { "@id": "https://gitlab.example.com/api/v4/projects/1/packages/nuget/metadata", "@type": "RegistrationsBaseUrl/3.0.0-rc", "comment": "Get package metadata." }, { "@id": "https://gitlab.example.com/api/v4/projects/1/packages/nuget/download", "@type": "PackageBaseAddress/3.0.0", "comment": "Get package content (.nupkg)." }, { "@id": "https://gitlab.example.com/api/v4/projects/1/packages/nuget", "@type": "PackagePublish/2.0.0", "comment": "Push and delete (or unlist) packages." }, { "@id": "https://gitlab.example.com/api/v4/projects/1/packages/nuget/symbolpackage", "@type": "SymbolPackagePublish/4.9.0", "comment": "Push symbol packages." } ] } ``` -------------------------------- ### GET v2 NuGet Source Feed Example Response Source: https://docs.gitlab.com/18.4/api/packages/nuget An example XML response representing the service index of the v2 NuGet source feed. ```xml Default Packages ```