diff options
author | Daniel Baumann <daniel@debian.org> | 2025-01-24 08:57:48 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2025-01-24 08:57:48 +0100 |
commit | c70c95ecbea0487586212a9437d120989a6c6e31 (patch) | |
tree | 140d166690b4cf72737075f15001eee07bfb4d6c /examples/docker-compose/compose-demo-workflow.yml | |
parent | Initial commit. (diff) | |
download | forgejo-runner-upstream.tar.xz forgejo-runner-upstream.zip |
Adding upstream version 6.2.0.HEADupstream/6.2.0upstreamdebian
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'examples/docker-compose/compose-demo-workflow.yml')
-rw-r--r-- | examples/docker-compose/compose-demo-workflow.yml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/docker-compose/compose-demo-workflow.yml b/examples/docker-compose/compose-demo-workflow.yml new file mode 100644 index 0000000..7f7beaa --- /dev/null +++ b/examples/docker-compose/compose-demo-workflow.yml @@ -0,0 +1,35 @@ +# Copyright 2024 The Forgejo Authors. +# SPDX-License-Identifier: MIT + +services: + + demo-workflow: + image: code.forgejo.org/oci/alpine:3.21 + links: + - forgejo + command: >- + sh -ec ' + apk add --quiet git curl jq ; + mkdir -p /srv/demo ; + cd /srv/demo ; + git init --initial-branch=main ; + mkdir -p .forgejo/workflows ; + echo "{ on: [push], jobs: { test: { runs-on: node-bookworm, steps: [ {uses: https://code.forgejo.org/actions/checkout@v4}, { run: echo All Good } ] } } }" > .forgejo/workflows/demo.yml ; + echo "{ on: [push], jobs: { test_docker: { runs-on: docker-cli, steps: [ { run: docker info, shell: sh } ] } } }" > .forgejo/workflows/demo_docker.yml ; + git add . ; + git config user.email root@example.com ; + git config user.name username ; + git commit -m demo ; + while : ; do + git push --set-upstream --force http://root:{ROOT_PASSWORD}@forgejo:3000/root/test main && break ; + sleep 5 ; + done ; + sha=`git rev-parse HEAD` ; + for delay in 1 1 1 1 2 5 5 10 10 10 15 30 30 30 30 30 30 30 ; do + curl -sS -f http://forgejo:3000/api/v1/repos/root/test/commits/$$sha/status | jq --raw-output .state | tee status ; + if grep success status ; then echo DEMO WORKFLOW SUCCESS && break ; fi ; + if grep failure status ; then echo DEMO WORKFLOW FAILURE && break ; fi ; + sleep $$delay ; + done ; + grep success status || echo DEMO WORKFLOW FAILURE + ' |