Skip to content

Commit 7c9a22f

Browse files
author
Your Name
committed
updated with suggestions-2
1 parent b0e4d0c commit 7c9a22f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

docker-compose.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,13 @@ services:
159159
160160
if [ ! -f /data/gogs/token.txt ]; then
161161
sleep 2
162-
RESPONSE=$$(curl -s -X POST http://gogs:3000/api/v1/users/$$GOGS_ADMIN_USERNAME/tokens \
162+
TOKEN=$$(curl -s \
163+
-X POST \
164+
-u $$GOGS_ADMIN_USERNAME:$$GOGS_ADMIN_PASSWORD \
163165
-H "Content-Type: application/json" \
164166
-d "{\"name\":\"bootstrap\"}" \
165-
-u $$GOGS_ADMIN_USERNAME:$$GOGS_ADMIN_PASSWORD)
166-
echo "Token response: $$RESPONSE"
167-
TOKEN=$$(echo "$$RESPONSE" | grep -o '"sha1":"[^"]*"' | cut -d'"' -f4)
167+
http://gogs:3000/api/v1/users/$$GOGS_ADMIN_USERNAME/tokens \
168+
| grep -o '"sha1":"[^"]*"' | cut -d'"' -f4)
168169
if [ -z "$$TOKEN" ]; then echo "Failed to get token"; exit 1; fi
169170
mkdir -p /data/gogs
170171
echo $$TOKEN > /data/gogs/token.txt

0 commit comments

Comments
 (0)