BuildID: 2258
Status: FAIL
Image: melezhik/sparrow:alpine
Worker status: OK
---
Date: 21.12.2022 @ 00:51
Time elapsed: 89 sec
---
SCM:
https://github.com/melezhik/sparrowci-bugzilla.git
Git sha: 3712589
Git comment: resolved. close!
secrets:
- BUGZILLA_RESTAPI_KEY
tasks:
-
name: main
default: true
language: Raku
config:
bugid: 1632727
init: |
run_task "comment";
run_task "close" if config()<tasks><git-commit><state><comment> ~~ /'close!'/;
subtasks:
-
name: comment
language: Bash
code: |
set -e
bugid=$(config bugid)
cat << HERE > data.json
{
"comment" : "This comment is made by SparrowCI",
"is_private" : false
}
HERE
curl -f -H "Content-Type: application/json" -X POST \
--data @data.json \
https://bugzilla-dev.allizom.org/rest/bug/$bugid/comment?api_key=$BUGZILLA_RESTAPI_KEY
echo "comment has been added to https://bugzilla-dev.allizom.org/show_bug.cgi?id=$bugid"
-
name: close
language: Bash
code: |
set -e
bugid=$(config bugid)
cat << "HERE" > data.json
{
"ids" : [$bugid],
"status" : "RESOLVED"
}
HERE
curl -f -H "Content-Type: application/json" -X PUT \
--data @data.json \
https://bugzilla-dev.allizom.org/rest/bug/$bugid?api_key=$BUGZILLA_RESTAPI_KEY
echo "bug has been closed https://bugzilla-dev.allizom.org/show_bug.cgi?id=$bugid"
depends:
-
name: git-commit
- name: git-commit
plugin: git-commit-data
config:
dir: source
[35m00:50:32[0m :: [repository] - index updated from https://sparrowhub.io/repo/api/v1/index
run stage: run
source directory does not yet exist, download source archive from storage
[35m00:50:37[0m :: [repository] - installing pack-unpack, version 0.000001
[1;36m[task run: task.bash - unpack source archive][0m
[1;36m[dump code: task.bash][0m
[1] set -e
[2]
[3] file=$(config file)
[4] dir=$(config dir)
[5]
[6] echo "tar -xzf $file "
[7]
[8] tar -xzf $file
[9]
[10] if test $dir; then
[11] ls -l $dir
[12] fi
[13]
[14]
[1;36m[task stdout][0m
[35m00:50:40[0m :: tar -xzf source.tar.gz
[1;36m[task run: task.bash - tasks/main][0m
[1;36m[dump code: task.bash][0m
[1] set -e
[2] bugid=$(config bugid)
[3] cat << HERE > data.json
[4] {
[5] "comment" : "This comment is made by SparrowCI",
[6] "is_private" : false
[7] }
[8] HERE
[9]
[10] curl -f -H "Content-Type: application/json" -X POST \
[11] --data @data.json \
[12] https://bugzilla-dev.allizom.org/rest/bug/$bugid/comment?api_key=$BUGZILLA_RESTAPI_KEY
[13]
[14] echo "comment has been added to https://bugzilla-dev.allizom.org/show_bug.cgi?id=$bugid"
[15]
[1;36m[task stdout][0m
[35m00:51:00[0m :: {"id":2301}comment has been added to https://bugzilla-dev.allizom.org/show_bug.cgi?id=1632727
[1;36m[task stderr][0m
[35m00:51:00[0m :: % Total % Received % Xferd Average Speed Time Time Time Current
[35m00:51:00[0m :: Dload Upload Total Spent Left Speed
[35m00:51:00[0m ::
[35m00:51:00[0m :: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
[35m00:51:00[0m :: 100 91 0 11 100 80 19 145 --:--:-- --:--:-- --:--:-- 165
[1;36m[task run: task.bash - tasks/main][0m
[1;36m[dump code: task.bash][0m
[1] set -e
[2] bugid=$(config bugid)
[3] cat << "HERE" > data.json
[4] {
[5] "ids" : [$bugid],
[6] "status" : "RESOLVED"
[7] }
[8] HERE
[9]
[10] curl -f -H "Content-Type: application/json" -X PUT \
[11] --data @data.json \
[12] https://bugzilla-dev.allizom.org/rest/bug/$bugid?api_key=$BUGZILLA_RESTAPI_KEY
[13]
[14] echo "bug has been closed https://bugzilla-dev.allizom.org/show_bug.cgi?id=$bugid"
[15]
[1;36m[task stdout][0m
[1;36m[task stderr][0m
[35m00:51:01[0m :: % Total % Received % Xferd Average Speed Time Time Time Current
[35m00:51:01[0m :: Dload Upload Total Spent Left Speed
[35m00:51:01[0m ::
[35m00:51:01[0m :: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
[35m00:51:01[0m :: 100 54 0 0 100 54 0 398 --:--:-- --:--:-- --:--:-- 400
[35m00:51:01[0m :: curl: (22) The requested URL returned error: 400
[35m00:51:01[0m :: task exit status: 22
[35m00:51:01[0m :: task tasks/main FAILED
The spawned command 'docker exec -i sparrow-worker sh -l /var/.sparrowdo/env/main/.sparrowdo/sparrowrun.sh' exited unsuccessfully (exit code: 22, signal: 0)
in block <unit> at /home/sph/.raku/resources/57C38AFDF922EB0C43584FF5F701A03850B5346F line 13
in sub MAIN at /home/sph/.raku/bin/sparrowdo line 3
in block <unit> at /home/sph/.raku/bin/sparrowdo line 1
[35m00:50:47[0m :: [repository] - index updated from https://sparrowhub.io/repo/api/v1/index
run stage: run
[35m00:50:51[0m :: [repository] - installing git-commit-data, version 0.000004
[1;36m[task run: task.bash - git-commit][0m
[1;36m[dump code: task.bash][0m
[1] cd $(config dir)
[2]
[3] echo "get commit data from $(pwd) ..."
[4]
[5] git show -s --format=%h > $cache_root_dir/sha.txt
[6] git show -s --format=%s > $cache_root_dir/comment.txt
[7]
[1;36m[task stdout][0m
[35m00:50:55[0m :: get commit data from /var/.sparrowdo/env/main/.sparrowdo/source ...
[1;36m[task run: task.pl6 - git-commit][0m
[1;36m[dump code: task.pl6][0m
[1] say "git commit: ", "{cache_root_dir()}/sha.txt".IO.slurp.chomp;
[2] say "git comment: ", "{cache_root_dir()}/comment.txt".IO.slurp.chomp;
[3]
[4]
[5] update_state({
[6] sha => "{cache_root_dir()}/sha.txt".IO.slurp.chomp,
[7] comment => "{cache_root_dir()}/comment.txt".IO.slurp.chomp
[8] });
[9]
[1;36m[task stdout][0m
[35m00:50:55[0m :: git commit: 3712589
[35m00:50:55[0m :: git comment: resolved. close!