Commit effc7884 authored by Ruben ten Hove's avatar Ruben ten Hove Committed by Federico Falconieri
Browse files

feat: resilient, atomic jobs and opionated pipelines

parent 023efde8
Loading
Loading
Loading
Loading
+38 −30
Original line number Diff line number Diff line
---
variables:
  PYTHON_PACKAGE: "templates_tests/python/mypackage"
  PYTHON_PACKAGE: "mypackage"

include:
  - local: "alm/semantic-release.yml"
@@ -9,17 +9,9 @@ include:

  - local: "docs/drawio.yml"

  - local: "docker/kaniko.yml"
  - local: "docker/anchore/grype.yml"

  - local: "python/bandit.yml"
  - local: "python/black.yml"
  - local: "python/isort.yml"
  - local: "python/pip-outdated.yml"
  - local: "python/pytest.yml"
  - local: "python/mypy.yml"
  - local: "python/pylint.yml"
  - local: "python/safety.yml"
  - local: "pipelines/poetry/docker-pro.yml"

  - local: "c/cppcheck.yml"
  - local: "c/flawfinder.yml"
@@ -35,14 +27,41 @@ docker:anchore:grype:
  variables:
    GRYPE_FAIL_ON: ""

python:poetry:check:
  before_script:
    - cd templates_tests/python

python:black:
  before_script:
    - cd templates_tests/python

python:bandit:
  before_script:
    - cd templates_tests/python

python:isort:
  before_script:
    - cd templates_tests/python

python:mypy:
  before_script:
    - cd templates_tests/python

python:pylint:
  before_script:
    - cd templates_tests/python

python:pytest:
  before_script:
    # We need to move here so it's added to PYTHONPATH
    - cd templates_tests/python
  variables:
    # Not happy with this, but we need it so --cov works
    # without breaking other jobs
    PYTHON_PACKAGE: mypackage

python:safety:
  before_script:
    - cd templates_tests/python

python:poetry:publish:
  before_script:
    - cd templates_tests/python

docker:kaniko:python-old:
  extends: docker:kaniko
@@ -51,14 +70,14 @@ docker:kaniko:python-old:

python:black-old:
  extends: python:black
  variables:
    PYTHON_PACKAGE: "templates_tests/python36/mypackage"
  before_script:
    - cd templates_tests/python36
  needs: ["docker:kaniko:python-old"]

python:poetry:pylint-old:
  extends: python:pylint
  variables:
    PYTHON_PACKAGE: "templates_tests/python36/mypackage"
  before_script:
    - cd templates_tests/python36
  needs: ["docker:kaniko:python-old"]

c:cppcheck:
@@ -71,17 +90,6 @@ c:flawfinder:
    ERROR_LEVEL: "6"
    CHECK_PATH: templates_tests/c

workflow:
  rules:
    # Run if we're in a merge request
    - if: $CI_MERGE_REQUEST_IID
    # Run for tags, so we get semantic versioning
    - if: $CI_COMMIT_TAG
    # Run for changes on the master branch (so merged MRs)
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    # Run for manually triggered jobs from gitlab UI
    - if: $CI_PIPELINE_SOURCE == 'web'

# We keep this downstream, as we don't expect many MRs for this specific test
downstream:pages:
  stage: test
+0 −6
Original line number Diff line number Diff line
@@ -39,9 +39,3 @@
      fi
    - printf "Will use the following destinations:${DESTINATIONS}\n" | sed 's/--destination=/\n/g'
    - /kaniko/executor --cache=${USE_CACHE} --context=${CONTEXT} --dockerfile=${DOCKERFILE} ${DESTINATIONS} ${LABELS} ${EXTRA_ARGS}
    - |
      if [ "${PYTHON_TEST}" = "true" ]; then
        printf "\nRUN if ! python3 -m pip >/dev/null; then wget -q https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py; fi" >> ${CONTEXT}/${DOCKERFILE}
        printf "\nRUN python3 -m pip install pytest pytest-cov pylint pylint_junit safety mutmut coverage" >> ${CONTEXT}/${DOCKERFILE}
        /kaniko/executor --cache=${USE_CACHE} --context=${CONTEXT} --dockerfile=${DOCKERFILE} --destination=${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}-testing ${EXTRA_ARGS}
      fi
+4 −0
Original line number Diff line number Diff line
---
include:
  - local: "python/poetry/check.yml"
  - local: "python/poetry/publish.yml"
+4 −0
Original line number Diff line number Diff line
---
include:
  - local: "pipelines/python-basic.yml"
  - local: "pipelines/poetry/base.yml"
+4 −0
Original line number Diff line number Diff line
---
include:
  - local: "pipelines/python-docker-basic.yml"
  - local: "pipelines/poetry/base.yml"
Loading