summaryrefslogtreecommitdiffstats
path: root/examples/docker-compose/compose-demo-workflow.yml
diff options
context:
space:
mode:
authorEarl Warren <contact@earl-warren.org>2023-08-24 12:28:17 +0200
committerEarl Warren <contact@earl-warren.org>2023-08-26 11:52:19 +0200
commitdeefb19f21f544504d4b4af9d22165c80d81ec74 (patch)
tree3bc26dca54ce61768de6eda88972a55dc35cbb38 /examples/docker-compose/compose-demo-workflow.yml
parentthe binaries are published in the runner repository (diff)
downloadforgejo-runner-deefb19f21f544504d4b4af9d22165c80d81ec74.tar.xz
forgejo-runner-deefb19f21f544504d4b4af9d22165c80d81ec74.zip
example docker compose file and test
Diffstat (limited to 'examples/docker-compose/compose-demo-workflow.yml')
-rw-r--r--examples/docker-compose/compose-demo-workflow.yml38
1 files changed, 38 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..2f61d4a
--- /dev/null
+++ b/examples/docker-compose/compose-demo-workflow.yml
@@ -0,0 +1,38 @@
+# Copyright 2023 The Forgejo Authors.
+# SPDX-License-Identifier: MIT
+
+version: "3"
+
+services:
+
+ demo-workflow:
+ image: alpine:3.18
+ links:
+ - forgejo
+ depends_on:
+ runner-register:
+ condition: service_completed_successfully
+ command: >-
+ sh -xc '
+ 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: docker, steps: [ { run: echo All Good } ] } } }" > .forgejo/workflows/demo.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:admin1234@forgejo:3000/root/test main && break ;
+ sleep 5 ;
+ done ;
+ sha=`git rev-parse HEAD` ;
+ while : ; do
+ curl -sS -f http://forgejo:3000/api/v1/repos/root/test/commits/$$sha/status | jq --raw-output .state | tee status ;
+ grep success status && break ;
+ sleep 5 ;
+ done ;
+ echo DEMO WORKFLOW SUCCESS
+ '