1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00

Create test repo on Gitpod start (#1248)

Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
Lukas 2022-10-09 22:13:04 +02:00 committed by GitHub
parent 12ff74c4cb
commit 6789e28df2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 1 deletions

View File

@ -40,6 +40,19 @@ tasks:
-d "{ \"name\": \"Woodpecker CI\", \"redirect_uris\": [ \"https://8000-${GITPOD_WORKSPACE_ID}.${GITPOD_WORKSPACE_CLUSTER_HOST}/authorize\" ] }")
echo WOODPECKER_GITEA_CLIENT=$(echo $GITEA_OAUTH_APP | jq -r .client_id) >> .env
echo WOODPECKER_GITEA_SECRET=$(echo $GITEA_OAUTH_APP | jq -r .client_secret) >> .env
curl -X 'POST' \
'http://localhost:3000/api/v1/user/repos' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H "Authorization: token ${GITEA_TOKEN}" \
-d '{ "auto_init": false, "name": "woodpecker-test", "private": true, "template": false, "trust_model": "default" }'
cd contrib/woodpecker-test-repo
git init
git checkout -b main
git remote add origin http://woodpecker:${GITEA_TOKEN}@localhost:3000/woodpecker/woodpecker-test.git
git add .
git commit -m ":tada: Initial commit"
git push -u origin main
gp sync-done gitea
$DOCKER_COMPOSE_CMD logs -f
- name: App

View File

@ -0,0 +1,5 @@
pipeline:
demo:
image: 'alpine'
commands:
- echo 'Demo'

View File

@ -0,0 +1,15 @@
pipeline:
test_1:
image: 'alpine'
commands:
- echo 'Test 1'
test_2:
image: 'alpine'
commands:
- echo 'Test 2'
test_3:
image: 'alpine'
commands:
- echo 'Test 3'

View File

@ -25,7 +25,7 @@ services:
USER_UID: 1000
USER_GID: 1000
# GITEA__server__DOMAIN: gitea.local.self
GITEA__server__ROOT_URL: http://gitea:3000
GITEA__server__ROOT_URL: https://3000-${GITPOD_WORKSPACE_ID}.${GITPOD_WORKSPACE_CLUSTER_HOST}
GITEA__database__DB_TYPE: postgres
GITEA__database__HOST: gitea-database:5432
GITEA__database__NAME: gitea
@ -33,6 +33,7 @@ services:
GITEA__database__PASSWD: 123456
GITEA__webhook__ALLOWED_HOST_LIST: "*"
GITEA__security__INSTALL_LOCK: "true"
GITEA__security__INTERNAL_TOKEN: "123456"
extra_hosts:
- "host.docker.internal:host-gateway"