Skip to content
Snippets Groups Projects
Open Fix multi-line "script" commands in ".gitlab-ci.yml"
  • View options
  • Fix multi-line "script" commands in ".gitlab-ci.yml"

  • View options
  • Open Issue created by Alex Ioannidis

    Multi-line .gitlab-ci. commands aren't executed correctly. Specifically the multi-line oc tag ... command in the import_image_to_openshift stage.

    Testing locally with gitlab-runner exec docker import_image_to_openshift (install here), acutally gives correct results for the following styles:

    # ">", indentation and backslahes "\"
    script:
      - >
        oc tag \
          --source=docker \
          ${CI_REGISTRY_IMAGE}/${APPLICATION_IMAGE_NAME}:${VERSION} \
          ${APPLICATION_IMAGE_NAME}:${VERSION} \
          --token ${TOKEN} \ 
          --server=${OPENSHIFT_SERVER} \
          -n ${OPENSHIFT_PROJECT_TAGS_NAME}
    
    # No ">" and no indentation
    script:
      - oc tag
        --source=docker
        ${CI_REGISTRY_IMAGE}/${APPLICATION_IMAGE_NAME}:${VERSION}
        ${APPLICATION_IMAGE_NAME}:${VERSION}
        --token ${TOKEN}
        --server=${OPENSHIFT_SERVER}
        -n ${OPENSHIFT_PROJECT_TAGS_NAME}
    • Merge request
    • Branch

    Linked items 0

  • Link items together to show that they're related or that one is blocking others.

    Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first
    Loading Loading Loading Loading Loading Loading Loading Loading Loading Loading