Loading inject-into-salsa-git +22 −7 Original line number Diff line number Diff line Loading @@ -36,6 +36,13 @@ if [ "$SALSA_GROUP_ID" = "" ] ; then exit 1 fi # Did we already push to salsa? set -x RESPONSE=$(curl "$SALSA_URL/projects?search=${DEBPKGNAME}") echo $RESPONSE | jq --exit-status "map(select(.path == \"${DEBPKGNAME}\")) | .[0].id" > /dev/null set +x if [ $? -ne 0 ]; then # Seems like not, lets create a project set -x RESPONSE=$(curl "$SALSA_URL/projects?private_token=$SALSA_TOKEN" \ --data "path=${DEBPKGNAME}&namespace_id=${SALSA_GROUP_ID}&description=${SHORTDESC}&visibility=public") Loading @@ -45,8 +52,16 @@ check_return_code PROJECT_ID=$(echo $RESPONSE | jq '.id') set +x else set -x PROJECT_ID=$(echo $RESPONSE | jq "map(select(.path == \"${DEBPKGNAME}\")) | .[0].id") set +x fi git remote show origin if [ $? -ne 0 ] ; then git remote add origin git@salsa.debian.org:${SALSA_GROUP}/${DEBPKGNAME}.git fi git push origin master git push --all --set-upstream git push --tags Loading Loading
inject-into-salsa-git +22 −7 Original line number Diff line number Diff line Loading @@ -36,6 +36,13 @@ if [ "$SALSA_GROUP_ID" = "" ] ; then exit 1 fi # Did we already push to salsa? set -x RESPONSE=$(curl "$SALSA_URL/projects?search=${DEBPKGNAME}") echo $RESPONSE | jq --exit-status "map(select(.path == \"${DEBPKGNAME}\")) | .[0].id" > /dev/null set +x if [ $? -ne 0 ]; then # Seems like not, lets create a project set -x RESPONSE=$(curl "$SALSA_URL/projects?private_token=$SALSA_TOKEN" \ --data "path=${DEBPKGNAME}&namespace_id=${SALSA_GROUP_ID}&description=${SHORTDESC}&visibility=public") Loading @@ -45,8 +52,16 @@ check_return_code PROJECT_ID=$(echo $RESPONSE | jq '.id') set +x else set -x PROJECT_ID=$(echo $RESPONSE | jq "map(select(.path == \"${DEBPKGNAME}\")) | .[0].id") set +x fi git remote show origin if [ $? -ne 0 ] ; then git remote add origin git@salsa.debian.org:${SALSA_GROUP}/${DEBPKGNAME}.git fi git push origin master git push --all --set-upstream git push --tags Loading