cloudfoundry-community / gogs-boshrelease

Gogs is a painless self-hosted Git service
https://gogs.io/
Apache License 2.0
5 stars 5 forks source link

gogs fails to create a mirror repo due to git client packaging #18

Open dyroberts opened 5 years ago

dyroberts commented 5 years ago

Steps to reproduce:

set -ex

export GOGS_ADMIN_USER= export GOGS_ADMIN_UID=1 export GOGS_ADMIN_PASSWORD= export GOGS_HOST= export GOGS_PORT=

export REMOTE_REPO_URL=https://github.com/habuma/myapp-config export MIRROR_REPO_NAME=config-mirror-3

export GOGS_TOKEN=cat token-response.json | jq --raw-output '.sha1'

export GOGS_TOKEN=curl $GOGS_HOST:$GOGS_PORT/api/v1/users/$GOGS_ADMIN_USER/tokens -H"Content-type: application/json" -d'{"name":"admintoken"}' -u$GOGS_ADMIN_USER:$GOGS_ADMIN_PASSWORD | jq --raw-output '.sha1' echo $GOGS_TOKEN

export GOGS_ADMIN_UID=curl "$GOGS_HOST:$GOGS_PORT/api/v1/user" -H"Authorization: token $GOGS_TOKEN" | jq --raw-output '.id' export CREATE_MIRROR_JSON="{\"clone_addr\": \"$REMOTE_REPO_URL\",\"uid\": $GOGS_ADMIN_UID,\"repo_name\": \"$MIRROR_REPO_NAME\",\"mirror\": true}"

curl "$GOGS_HOST:$GOGS_PORT/api/v1/repos/migrate" -d"$CREATE_MIRROR_JSON" -H"Content-type: application/json" -H"Authorization: token $GOGS_TOKEN"


Expected behaviour: mirror repo created on gogs called config-mirror-3
Actual behaviour: final curl call to gogs api returns the following error
`{"message":"Clone: exit status 128 - fatal: Unable to find remote helper for 'https'\n","url":"https://github.com/gogs/go-gogs-client/wiki"}`

It seems this has something to do with the curl installed by apt-get in the git package script.
My understanding is that it would be best not to rely on apt-get in a bosh package script anyway as it's not portable.
PR to follow!
drnic commented 5 years ago

@pivotal-dylan-roberts I had lazily decided to keep the apt-get stuff in the packaging script because I was putting pre-compiled releases in the manifests/gogs.yml via CI; so packaging was never used by end operators, only by developers (you) and CI.

But if its not actually installing good packages, then that's no good at all! :)