Commit 6bc673e0 authored by Federico Falconieri's avatar Federico Falconieri
Browse files

Merge branch 'hoverht-master-patch-82527' into 'master'

fix: default container packages not checked by default

Closes #24

See merge request ci/templates!18
parents f3ac1f55 cbcb7e27
Loading
Loading
Loading
Loading
+9 −16
Original line number Diff line number Diff line
@@ -4,23 +4,16 @@ python:pip:outdated:
  stage: test
  image: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
  variables:
    CHECK_ALL: "false"  # Set to true if you also want to check packages such as pip, setuptools and dependencies of your dependencies
    EXTRA_ARGS: ""
  script:
    - echo "CHECK_ALL=${CHECK_ALL}"
    - OUTDATED="$(pip list --outdated --format freeze)"
    - |
      if "${CHECK_ALL}" = "true"; then
      OUTDATED="$(pip list --outdated --format freeze)"
      if [ ! -z "${OUTDATED}" ]; then
        echo "[!] Your image has outdated packages:"
          pip list --outdated
        pip list --outdated ${EXTRA_ARGS}
        echo "These may not all be dependencies of your package, but these are shipped in your Docker image. Consider updating all packages by default."
        echo "If it still fails after updating, you may have a package requiring an outdated dependency. You may then ignore this outdated package."
        exit 1
      fi
      else
        OUTDATED_NOT_REQUIRED="$(pip list --outdated --format freeze --not-required)"
        if [ ! -z "${OUTDATED_NOT_REQUIRED}" ]; then
          echo "[!] Your image has outdated packages:"
          pip list --outdated --not-required
          exit 1
        fi
      fi
    - echo "[+] Well done! You're up to date."
  allow_failure: true