Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GitLab CI's 'image' dictionary format #230

Open
xanarin opened this issue Sep 26, 2023 · 0 comments
Open

Support GitLab CI's 'image' dictionary format #230

xanarin opened this issue Sep 26, 2023 · 0 comments
Labels
enhancement gitlab-ci Issues related to compatibility with .gitlab-ci.yml starter-bug A good bug for new contributors

Comments

@xanarin
Copy link
Collaborator

xanarin commented Sep 26, 2023

GitLab CI supports both a bare string and a dictionary for the image key. This is their reference for the possible values of an image key. Scuba should support this format (as much as it is able) so that a developer can !from_yaml .gitlab-ci.yml myjob.image without concern of Scuba not being able to understand the dictionary and its keys.

Some examples of legitimate uses of image according to GitLab's documentation:

  • Bare string

    build_all:
      image: "xanarin/base-build:1.17"
      script: "make -j24"
  • Dictionary with image name:

    build_all:
      image:
        name: "xanarin/base-build:1.17"
      script: "make -j24"
  • Dictionary with entrypoint:

    build_all:
      image:
        name: "xanarin/base-build:1.17"
        entrypoint: ["/usr/bin/bash", "/opt/run_with_env.sh"]
      script: "make -j24"
  • Dictionary with "pull policy" (can have value always, if-not-present, or never)

    build_all:
      image:
        name: "xanarin/base-build:1.17"
        pull_policy: always
      script: "make -j24"
  • Dictionary with pull policy array

    build_all:
      image:
        name: "xanarin/base-build:1.17"
        pull_policy: [always, if-not-present]
      script: "make -j24"

I don't know if Scuba should to fully support the pull_policy directive (in the sense that it obeys the policy), but at a minimum I think Scuba shouldn't error out if it encounters that directive.

@JonathonReinhart JonathonReinhart added enhancement starter-bug A good bug for new contributors gitlab-ci Issues related to compatibility with .gitlab-ci.yml labels Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement gitlab-ci Issues related to compatibility with .gitlab-ci.yml starter-bug A good bug for new contributors
Projects
None yet
Development

No branches or pull requests

2 participants