Verified Commit 3643b561 authored by Matthias Adamczyk's avatar Matthias Adamczyk
Browse files

Add Gitlab CI config

parent a53ae681
stages:
- setup
- triggers
# Since the gitlab-ci.yml format is relatively limited, we generate the nixos-rebuild jobs as a child pipeline
# See https://about.gitlab.com/blog/2020/04/24/parent-child-pipelines/ for more info on child pipelines
generate-nixos-pipeline:
stage: setup
tags:
- operations-nix
script:
- nix-build .nixos-gitlab-ci.yml.nix
- cp result .nixos-gitlab-ci.yml
artifacts:
paths:
- .nixos-gitlab-ci.yml
nixos:
stage: triggers
needs:
- generate-nixos-pipeline
trigger:
include:
- artifact: .nixos-gitlab-ci.yml
job: generate-nixos-pipeline
strategy: depend
editorconfig:
stage: triggers
needs: []
tags:
- operations-nix
script:
- nix-shell -p editorconfig-checker --run editorconfig-checker -I nixpkgs=channel:nixos-unstable
iso_image:
stage: triggers
needs: []
tags:
- operations-nix
script:
- nix-build -A isoImage
artifacts:
paths:
- result/*
kexec_tarball:
stage: triggers
needs: []
tags:
- operations-nix
script:
- nix-build -A kexec_tarball
artifacts:
paths:
- result/*
let
inherit (import ./.) hosts pkgs lib;
jobs = lib.mapAttrs (
name: host: {
stage = "build";
tags = [ "operations-nix" ];
variables.GIT_DEPTH = 0;
script = [
"nix-build --show-trace --pure-eval --option allow-import-from-derivation false --expr \"( (import (fetchGit { url = ./.; rev = \\\"$(git describe --always --abbrev=0)\\\"; })).deploy.${name} )\""
];
}
) (
lib.filterAttrs (
name: host: !host.config.skipCI
) hosts
);
in pkgs.writeText "nixos-gitlab-ci.yml" (builtins.toJSON jobs)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment