Search code examples
gitlab-cigitlab-ci-runner

How to store artifact file for Gitlab CI scheduled pipelines


I see that artifacts are belongs to pipeline. Is there any way to store artifacts(json file) for forever and mount into Gitlab pipline?

I need to run scheduled and automated updates of K8s. For that I'm store upgrade status in json file, this json file used/updated by other scheduled automated update. If artifacts belongs to pipeline, I have keep track of pipline numbers.

So is there any easy way to store data in artifact and get mounted while pipeline is running for update?


Solution

  • cache solves my problem

    aks-baseline-k8s-update:
      stage: k8s-update
      image: "toolbox:master"
    
      script:
        - update.sh
      cache:
        key: upgrade-history
        paths:
          - upgrade-history.json
      only:
        refs:
          - schedules
        variables:
          - $SCHEDULE_TYPE == "aks-k8s"