Project: update-repo

Run now
Configuration:

#crontab: "2 * * * *" sparrowdo: no_sudo: true no_index_update: false bootstrap: false format: default repo: https://sparrowhub.io/repo disabled: false keep_builds: 5 allow_manual_run: true scm: url: https://github.com/melezhik/sparrow-plugins.git branch: master
Scenario:

#!raku directory "scm"; my $sha = tags()<SCM_SHA> || "HEAD"; my $commit-file = "{%*ENV<HOME>}/sparrow-repo-commit"; my $old-commit = ($commit-file.IO ~~ :f ) ?? ($commit-file.IO.slurp) !! "HEAD"; say "current commit is: $sha, old commit is: $old-commit"; git-scm tags()<SCM_URL> || "git@github.com:melezhik/sparrow-plugins.git", %( to => "scm", branch => tags<SCM_BRANCH> || "master" ); my %state = task-run "get dirs", "git-updated-dirs", %( dir => "scm", commit_old => $old-commit, commit_new => $sha, level => 0, ); for %state<list><> -> $d { say "handle dir: $d ..."; "scm/$d/sparrow.json".IO ~~ :e or next; bash "s6 --upload", %( description => "update plugin [$d]", cwd => "{%*ENV<PWD>}/scm/$d", envvars => { SP6_REPO => "file://{%*ENV<HOME>}/repo", } ) } say "save $sha to $commit-file"; $commit-file.IO.spurt($sha); bash "s6 --index-update", %( envvars => { SP6_REPO => "file://{%*ENV<HOME>}/repo", } );