Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek-v3-0324· DeepSeekHugging Face LMArena Human Preference 140K

I have this gitlab job: .build: stage: build image: name:…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-sonnet-4-20250514’s answer.
  1. User

    I have this gitlab job:

    .build: stage: build image: name: gcr.io/kaniko-project/executor:v1.9.0-debug entrypoint: [ "" ] script: - | if [[ "DOCKERFILE"==∗/∗]];thenDPATH="{DOCKER_FILE}" == */* ]]; then DPATH="{DOCKER_FILE%/*}" # get the dirname (path only) DFILE="{DOCKER_FILE##*/}" # get the basename (filename only) else DPATH="." DFILE="{DOCKER_FILE}" # If no path, DOCKER_FILE is just the filename fi - echo "DPATH: {DPATH}" # For debugging - echo "DFILE: {DFILE}" # For debugging - /kaniko/executor --context "DPATH"−−dockerfile"{DPATH}" --dockerfile "{DFILE}" --destination "IMAGE:IMAGE:CI_COMMIT_TAG" --build-arg PIP_PIPE_INSTALL_TOKEN="PIPPIPEINSTALLTOKEN"PIP_PIPE_INSTALL_TOKEN" {EXTRA_ARGS} - --cache=true - --cache-ttl=168h - --cache-repo=CIREGISTRYIMAGE/kaniko−cacherules:−if:′{CI_REGISTRY_IMAGE}/kaniko-cache rules: - if: 'BUILD == "true" && CICOMMITTAG′exists:−CI_COMMIT_TAG' exists: - {DOCKER_FILE}

    build: extends: .build variables: DOCKER_FILE: Dockerfile IMAGE: $CI_REGISTRY_IMAGE EXTRA_ARGS: ""

    I get this error: jobs:build:script config should be a string or a nested array of strings up to 10 levels deep

  2. DeepSeek Assistant

    The error you're encountering is because the script section in your GitLab CI job is not properly formatted. In GitLab CI, each script command should be a separate string in an array, or a single string with commands separated by newlines.

    Here's the corrected version of your job:

    .build:
      stage: build
      image:
        name: gcr.io/kaniko-project/executor:v1.9.0-debug
        entrypoint: [ "" ]
      script:
        - |
          if [[ "${DOCKER_FILE}" == */* ]]; then
            DPATH="${DOCKER_FILE%/*}"     # get the dirname (path only)
            DFILE="${DOCKER_FILE##*/}"    # get the basename (filename only)
          else
            DPATH="."
            DFILE="${DOCKER_FILE}" # If no path, DOCKER_FILE is just the filename
          fi
          echo "DPATH: ${DPATH}" # For debugging
          echo "DFILE: ${DFILE}" # For debugging
          /kaniko/executor --context "${DPATH}" --dockerfile "${DFILE}" --destination "$IMAGE:$CI_COMMIT_TAG" --build-arg PIP_PIPE_INSTALL_TOKEN="$PIP_PIPE_INSTALL_TOKEN" ${EXTRA_ARGS} - --cache=true - --cache-ttl=168h - --cache-repo=${CI_REGISTRY_IMAGE}/kaniko-cache
      rules:
        - if: '$BUILD == "true" && $CI_COMMIT_TAG'
          exists:
            - ${DOCKER_FILE}
    
    build:
      extends: .build
      variables:
        DOCKER_FILE: Dockerfile
        IMAGE: $CI_REGISTRY_IMAGE
        EXTRA_ARGS: ""
    

    Key changes:

    1. Combined all the script commands into a single multi-line string (using the | character)
    2. Removed the separate - echo commands and included them in the same script block
    3. The entire script is now one YAML string rather than multiple array items

    This format is more appropriate for GitLab CI as it keeps related commands together in a single script block while maintaining proper YAML syntax.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.