@@ -8,13 +8,15 @@ services:
88 - ./phpunit.xml:/usr/local/src/phpunit.xml
99 - gitea-data:/data:ro
1010 - forgejo-data:/forgejo-data:ro
11+ - gogs-data:/gogs-data:ro
1112 environment :
1213 - TESTS_GITHUB_PRIVATE_KEY
1314 - TESTS_GITHUB_APP_IDENTIFIER
1415 - TESTS_GITHUB_INSTALLATION_ID
1516 - TESTS_GITEA_URL=http://gitea:3000
1617 - TESTS_GITEA_REQUEST_CATCHER_URL=http://request-catcher:5000
1718 - TESTS_FORGEJO_URL=http://forgejo:3000
19+ - TESTS_GOGS_URL=http://gogs:3000
1820 depends_on :
1921 gitea :
2022 condition : service_healthy
@@ -24,6 +26,10 @@ services:
2426 condition : service_healthy
2527 forgejo-bootstrap :
2628 condition : service_completed_successfully
29+ gogs :
30+ condition : service_healthy
31+ gogs-bootstrap :
32+ condition : service_completed_successfully
2733 request-catcher :
2834 condition : service_started
2935
@@ -115,6 +121,46 @@ services:
115121 fi
116122 "
117123
124+ gogs :
125+ image : gogs/gogs:0.13
126+ environment :
127+ - GOGS_CUSTOM=/data/gogs
128+ volumes :
129+ - gogs-data:/data
130+ - ./tests/resources/gogs-custom/conf/app.ini:/data/gogs/conf/app.ini
131+ ports :
132+ - " 3002:3000"
133+ healthcheck :
134+ test : ["CMD", "curl", "-f", "http://localhost:3000/"]
135+ interval : 10s
136+ timeout : 5s
137+ retries : 10
138+ start_period : 15s
139+
140+ gogs-bootstrap :
141+ image : gogs/gogs:0.13
142+ volumes :
143+ - gogs-data:/data
144+ depends_on :
145+ gogs :
146+ condition : service_healthy
147+ entrypoint : /bin/sh
148+ environment :
149+ - GOGS_ADMIN_USERNAME=${GOGS_ADMIN_USERNAME:-utopia}
150+ - GOGS_ADMIN_PASSWORD=${GOGS_ADMIN_PASSWORD:-password}
151+ - GOGS_ADMIN_EMAIL=${GOGS_ADMIN_EMAIL:-utopia@example.com}
152+ command : >
153+ -c "
154+ su git -c \"/opt/gogs/gogs admin create-user --name=$$GOGS_ADMIN_USERNAME --password=$$GOGS_ADMIN_PASSWORD --email=$$GOGS_ADMIN_EMAIL --admin\" || true &&
155+ if [ ! -f /data/gogs/token.txt ]; then
156+ apk add --no-cache curl jq &&
157+ TOKEN=$$(curl -s -X POST http://gogs:3000/api/v1/users/$$GOGS_ADMIN_USERNAME/tokens -H 'Content-Type: application/json' -d '{\"name\":\"bootstrap-token\"}' -u $$GOGS_ADMIN_USERNAME:$$GOGS_ADMIN_PASSWORD | jq -r '.sha1') &&
158+ mkdir -p /data/gogs &&
159+ echo $$TOKEN > /data/gogs/token.txt;
160+ fi
161+ "
162+
118163volumes :
119164 gitea-data :
120- forgejo-data:
165+ forgejo-data :
166+ gogs-data:
0 commit comments