push self to the test forgejo instance

This commit is contained in:
Earl Warren 2023-03-25 16:20:38 +01:00
parent c92246a058
commit 844a9cd4ff
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 15 additions and 18 deletions

View file

@ -10,14 +10,5 @@ jobs:
./docker.sh
./forgejo.sh setup root admin1234 codeberg.org/forgejo/forgejo:1.19
./forgejo-runner.sh setup
#
# Can this Forgejo & runner combination...
#
#
# ...run a demo workflow (stage 0)
#
# testdata/run.sh workflow http://root:admin1234@$(cat forgejo-ip):3000 root demo
#
# ...run this integration test (stage 1)
#
testdata/run.sh self http://root:admin1234@$(cat forgejo-ip):3000 root
testdata/run.sh push_self http://root:admin1234@$(cat forgejo-ip):3000 root

22
testdata/run.sh vendored
View file

@ -65,18 +65,24 @@ function workflow() {
wait_success "$forgejo" "$owner/$workflow" $(cat $DIR/$workflow/SHA)
}
function self() {
function push_self() {
local forgejo="$1"
local owner="$2"
local dir="$DIR/self"
if git remote | grep -q test-setup-forgejo; then
git remote rm test-setup-forgejo
fi
git remote add test-setup-forgejo $forgejo/$owner/setup-forgejo
git push test-setup-forgejo HEAD:main
wait_success "$forgejo" "$owner/setup-forgejo" $(git rev-parse HEAD)
local sha=$(git rev-parse HEAD)
git clone . $dir
(
cd $dir
git checkout -b fortesting $sha
git remote rm origin
git remote add origin $forgejo/$owner/setup-forgejo
git rm -r .forgejo
git config user.email root@example.com
git config user.name username
git commit -m 'avoid workflow infinite recursion'
git push origin fortesting:main
)
}
"$@"