# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0

stages:
  - generate
  - start

generatePipeline:
  stage: generate
  image: "nixos/nix:latest"
  script:
    - "nix build -v -f . nix.gitlab-ci --substituters \"https://cache.nixos.org/ s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1\""
    - "cat ./result > gitlab-ci.yml"
  artifacts:
    paths:
      - gitlab-ci.yml
    expire_in: '30 days'
  tags:
    - cacher

startPipeline:
  stage: start
  trigger:
    strategy: depend
    include:
      - artifact: gitlab-ci.yml
        job: generatePipeline