277 plugins

Home

Plugins

GitHub

Blog

Welcome to SparrowHub - Raku plugins for daily $work

SparrowHub is a repository of Raku plugins - small automation utilities get run as Raku functions
Sparrow is an automation engine that runs the plugins
Plugins could be written on many languages but for end user they are Raku tasks
Raku is a modern and powerful language. Sparrow makes it possible to integrate your code written on many other languages into Raku scenarios
Sparrow is you number one helper with daily automation tasks, it's super flexible and fun to use. Try it out! (See examples bellow)

Installation

zef install --/test Sparrow6
export SP6_REPO=http://sparrowhub.io/repo

Raku plugins for daily $work

  • Git
  • CICD
  • Kubernetes
  • Azure
  • Development

Set up Git

task-run "set git", "git-base", %(
  email => 'melezhik@gmail.com',
  name  => 'Alexey Melezhik',
  config_scope => 'local',
  set_credential_cache => 'on'
);

List total commits by author (sorted by commit count)
my %state = task-run "commits-by-authors", "git-commits-by-author";

for %state%<list><> -> $i {
  say "author: ",$i, "commits: ", $i, "email: ", $i
}

Aueue Azure DevOps build and wait till it finishes

my %state = task_run "run my build", "ado-pipeline-build", %(
  name => "WebApp",
  variables => "foo:1 bar:2"
  action => "run"
);

# wait till the my  build finishes
task_run "wait my build", "ado-pipeline-build", %(
  action => "wait",
  build_id => %state<build_id>
);

Run GitLab Pipeline
task-run "pipe-run", "gitlab-run-pipeline", %(
  debug => True,
  project => 1001,
  gitlab_api => "https://git.company.com/api/v4/",
  variables => %(
    color => "green",
    size => "big",
    use_salt => True
  )
)

Test if a k8s deployment exists and has attributes

task-run "dpl check", "k8s-deployment-check" %(
  name => "animals",
  namespace => "pets",
  cat => %(
    command => "/usr/bin/cat",
    args => [
      "eat", "milk", "fish" 
    ],
    env => [
      "ENABLE_LOGGING"
    ]
    volume-mounts => {
      foo-bar => "/opt/foo/bar",
    }
  )
);

Test if k8s config map exists and has entries
task-run "cm check", "k8s-config-check", %(
  type => "configmap",
  name => "web-config",
  namespace => "dashboards",
  # check if we have admin and password entries 
  # in config map
  data => [
    "note: creds for login",
    "[admin=root]",
    'regexp: "[password=" \S+ "]" $$',
  ]
);

Check that Azure KV secrets exists

task-run "check secrets", "azure-kv-secrets-check", %(
  name => "kv100", # the name of keyvault
  exists => [ # these keys should exists
    'password1',
    'password2',
    'db-password1',
    'db-password2'
  ]
)

Calculate permission number for Azure Devops permissions
task-run "permissions sum", "ado-permissions-calculator", %(
  namespace => "Library",
  actions => qqw{View Create}
);

Lint yaml files

task-run "lint these files", "yaml-lint", %(
  files => "path/to/dir/*.yaml",
  use_python => False
);

Clean up python cache files
task-run "clean-cache", "python-helpers", %(
  task => "clean-cache",
  dir => [ "{%*ENV}/.local", '/tmp/foo/' ]
)

News

08/19/2021 - Oh my Tomtit - alternative to oh my zsh written on Raku 08/16/2021 - Sparrow plugin to run gitlab pipelines programmatically 08/13/2021 - Bird - Raku DSL for infrastructure testing 08/07/2021 - 5 minutes introduction into Sparrow , 5 minutes introduction into Bird. RakuConf. Youtube presentation. 07/26/2021 - Validating k8s deployments using Sparrow. 07/22/2021 - Sparrow plugin to convert markdown to pdf. 07/04/2021 - Write devopsish tests using Tomty and Raku. 28/06/2021 - Baking Rakudo Releases With R3 12/15/2020 - Sparky on k8s cluster. 12/07/2020 - Day 7: Mixing Bash and Raku Using Sparrow 11/10/2020 - Sparrowdo - Ubiquitous Asynchronous Task Runner ( with Nice Frontend ). 10/05/2020 - Development workflow management using Tomtit. 09/28/2020 - Sparrowhub.io - repository of devops and automation utilities. 12/24/2019 - Simple blackbox testing with Raku and Sparrow6