File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments