mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Improve CICD gitea app setup
This commit is contained in:
1 parent
f9876aba8f
commit
b08d572d71
3 files changed
+25
-4
No files matched your search
@@ -489,6 +489,17 @@ jobs:
|
||||
sleep 15
|
||||
done
|
||||
|
||||
- name: Provision Gitea
|
||||
if: matrix.service.name == 'VCSGitea'
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
docker compose up -d --wait gitea gitea-bootstrap
|
||||
CREDS=$(docker compose exec -T gitea cat /data/gitea/oauth.json)
|
||||
CLIENT_SECRET=$(echo "$CREDS" | jq -r .client_secret)
|
||||
echo "::add-mask::$CLIENT_SECRET"
|
||||
echo "_APP_VCS_GITEA_CLIENT_ID=$(echo "$CREDS" | jq -r .client_id)" >> $GITHUB_ENV
|
||||
echo "_APP_VCS_GITEA_CLIENT_SECRET=$CLIENT_SECRET" >> $GITHUB_ENV
|
||||
|
||||
- name: Load and Start Appwrite
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
su git -c "gitea admin user create --username $GITEA_ADMIN_USERNAME --password $GITEA_ADMIN_PASSWORD --email $GITEA_ADMIN_EMAIL --admin --must-change-password=false" || true
|
||||
|
||||
if [ ! -f /data/gitea/oauth.json ]; then
|
||||
curl -sf -X POST -u "$GITEA_ADMIN_USERNAME:$GITEA_ADMIN_PASSWORD" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"name":"Appwrite","redirect_uris":["http://localhost/v1/vcs/gitea/callback"],"confidential_client":true}' \
|
||||
http://gitea:3000/api/v1/user/applications/oauth2 > /tmp/oauth.json
|
||||
mv /tmp/oauth.json /data/gitea/oauth.json
|
||||
fi
|
||||
@@ -382,6 +382,7 @@ services:
|
||||
- appwrite
|
||||
volumes:
|
||||
- appwrite-gitea:/data
|
||||
- ./dev/gitea/setup.sh:/setup.sh:ro
|
||||
depends_on:
|
||||
gitea:
|
||||
condition: service_healthy
|
||||
@@ -390,10 +391,7 @@ services:
|
||||
- GITEA_ADMIN_PASSWORD=${GITEA_ADMIN_PASSWORD:-password}
|
||||
- GITEA_ADMIN_EMAIL=${GITEA_ADMIN_EMAIL:-gitea@appwrite.io}
|
||||
entrypoint: /bin/sh
|
||||
command: >
|
||||
-c "
|
||||
su git -c \"gitea admin user create --username $$GITEA_ADMIN_USERNAME --password $$GITEA_ADMIN_PASSWORD --email $$GITEA_ADMIN_EMAIL --admin --must-change-password=false\" || true
|
||||
"
|
||||
command: /setup.sh
|
||||
appwrite-mongo-express:
|
||||
profiles:
|
||||
- mongodb
|
||||
|
||||
Reference in new issue
Block a user