Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 59 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ services:
- ./phpunit.xml:/usr/local/src/phpunit.xml
- gitea-data:/data:ro
- forgejo-data:/forgejo-data:ro
- gogs-data:/gogs-data:ro
environment:
- TESTS_GITHUB_PRIVATE_KEY
- TESTS_GITHUB_APP_IDENTIFIER
- TESTS_GITHUB_INSTALLATION_ID
- TESTS_GITEA_URL=http://gitea:3000
- TESTS_GITEA_REQUEST_CATCHER_URL=http://request-catcher:5000
- TESTS_FORGEJO_URL=http://forgejo:3000
- TESTS_GOGS_URL=http://gogs:3000
depends_on:
gitea:
condition: service_healthy
Expand All @@ -24,6 +26,10 @@ services:
condition: service_healthy
forgejo-bootstrap:
condition: service_completed_successfully
gogs:
condition: service_healthy
gogs-bootstrap:
condition: service_completed_successfully
request-catcher:
condition: service_started

Expand Down Expand Up @@ -115,6 +121,58 @@ services:
fi
"

gogs:
image: gogs/gogs:0.14
volumes:
- gogs-data:/data
- ./resources/gogs/app.ini:/data/gogs/conf/app.ini
ports:
- "3002:3000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s

gogs-bootstrap:
image: gogs/gogs:0.14
volumes:
- gogs-data:/data
- ./resources/gogs/app.ini:/data/gogs/conf/app.ini
depends_on:
gogs:
condition: service_healthy
entrypoint: /bin/sh
environment:
- GOGS_ADMIN_USERNAME=${GOGS_ADMIN_USERNAME:-utopia}
- GOGS_ADMIN_PASSWORD=${GOGS_ADMIN_PASSWORD:-password}
- GOGS_ADMIN_EMAIL=${GOGS_ADMIN_EMAIL:-utopia@example.com}
command:
- -c
- |
USER=git /app/gogs/gogs admin create-user \
--admin \
--name $$GOGS_ADMIN_USERNAME \
--password $$GOGS_ADMIN_PASSWORD \
--email $$GOGS_ADMIN_EMAIL \
--config /data/gogs/conf/app.ini || true

if [ ! -f /data/gogs/token.txt ]; then
sleep 2
TOKEN=$$(curl -s \
-X POST \
-u $$GOGS_ADMIN_USERNAME:$$GOGS_ADMIN_PASSWORD \
-H "Content-Type: application/json" \
-d "{\"name\":\"bootstrap\"}" \
http://gogs:3000/api/v1/users/$$GOGS_ADMIN_USERNAME/tokens \
| grep -o '"sha1":"[^"]*"' | cut -d'"' -f4)
if [ -z "$$TOKEN" ]; then echo "Failed to get token"; exit 1; fi
mkdir -p /data/gogs
echo $$TOKEN > /data/gogs/token.txt
fi

volumes:
gitea-data:
forgejo-data:
forgejo-data:
gogs-data:
31 changes: 31 additions & 0 deletions resources/gogs/app.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
BRAND_NAME = Gogs
RUN_USER = git
RUN_MODE = prod

[database]
TYPE = sqlite3
PATH = /data/gogs.db

[repository]
ROOT = /data/repositories
DEFAULT_BRANCH = master

[server]
DOMAIN = gogs
HTTP_PORT = 3000
EXTERNAL_URL = http://gogs:3000/
DISABLE_SSH = true

[security]
INSTALL_LOCK = true
SECRET_KEY = aRandomString
LOCAL_NETWORK_ALLOWLIST = *

[webhook]
DELIVER_TIMEOUT = 10
SKIP_TLS_VERIFY = true

[log]
MODE = file
LEVEL = Info
ROOT_PATH = /data/gogs/log
1 change: 1 addition & 0 deletions src/VCS/Adapter/Git/Gitea.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public function createRepository(string $owner, string $repositoryName, bool $pr
]);

return $response['body'] ?? [];
// return is_array($body) ? $body : [];
}

public function createOrganization(string $orgName): string
Expand Down
Loading
Loading