Commit b828066f authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

feat: improved cache management

parent 28ef4532
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -618,12 +618,18 @@ stages:
  before_script:
    - !reference [.{{ cookiecutter.template_prefix }}-scripts]
    - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"
  # Cache downloaded dependencies and plugins between builds.
  # To keep cache across branches add 'key: "$CI_JOB_NAME"'
  # TODO (if necessary): define cache policy here
  variables:
    # TODO (if necessary): set cache dir variables
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
  cache:
    # cache shall be per branch per template
    key: "${CI_COMMIT_REF_SLUG}-{{ cookiecutter.project_slug }}"
    fallback_keys:
      - "${CI_DEFAULT_BRANCH}-{{ cookiecutter.project_slug }}"
    when: always
    # cache shall be per branch per template
    key: "$CI_COMMIT_REF_SLUG-{{ cookiecutter.project_slug }}"
    when: always
    paths:
      - .cache/

@@ -906,10 +912,15 @@ stages:
    - name: "$TBC_TRACKING_IMAGE"
      command: ["--service", "{{ cookiecutter.project_slug }}", "1.0.0"]
  stage: acceptance
  # TODO (if necessary): define cache policy here
  variables:
    # TODO (if necessary): set cache dir variable
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
  cache:
    # cache shall be per branch per template
    key: "${CI_COMMIT_REF_SLUG}-{{ cookiecutter.project_slug }}"
    fallback_keys:
      - "${CI_DEFAULT_BRANCH}-{{ cookiecutter.project_slug }}"
    when: always
    paths:
      - .cache/
  before_script: