Skip to content
Snippets Groups Projects
rm-gitlab-pipelines.nix 541 B
Newer Older
Volker Schukai's avatar
Volker Schukai committed
{
  pkgs,
  buildRoot,
  projectDefinition,
  ...
}: let
common = import "${./common.nix}" {inherit pkgs;};
Volker Schukai's avatar
Volker Schukai committed
in ''
  #!${pkgs.bash}/bin/bash
  ${common}

  echo_section "Deleting pipelines"

  pipeline_list=$(${pkgs.glab}/bin/glab ci list)

  commit_hashes=$(echo "$pipeline_list" | awk '/#/{print $3}')
  for hash in $commit_hashes; do
      hh=$(echo "$hash" |  ${pkgs.coreutils}/bin/cut -d"#" -f2)
      echo_step "Deleting pipeline for commit $hh"
      ${pkgs.glab}/bin/glab ci delete "$hh"
  done

  echo_ok "All pipelines deleted"

''