Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
Fix obtaining of group
· 21866dad
Andreas Tille
authored
May 15, 2018
21866dad
MOce salsarc file to ~/.ssh to enable calling this script from everywhere
· d61da287
Andreas Tille
authored
May 24, 2018
d61da287
Hide whitespace changes
Inline
Side-by-side
inject-into-salsa-git
View file @
d61da287
...
...
@@ -2,14 +2,14 @@
set
-eu
S
CRDIR
=
`
dirname
$0
`
S
ALSARC
=
~/.ssh/salsarc
if
[
!
-f
$
{
SCRDIR
}
/salsarc
]
;
then
echo
"Missing
${
S
CRDIR
}
/salsarc
"
if
[
!
-f
$
SALSARC
]
;
then
echo
"Missing
${
S
ALSARC
}
"
exit
1
fi
.
${
S
CRDIR
}
/salsarc
.
${
S
ALSARC
}
DEBPKGNAME
=
`
dpkg-parsechangelog |
awk
'/^Source:/ {print $2}'
`
SHORTDESC
=
`
grep
"^Description: "
debian/control |
head
-n
1 |
sed
's/^Description: //'
`
...
...
@@ -19,13 +19,14 @@ SALSA_GROUP=`echo $VCSGIT | sed -e 's#.*://salsa.debian.org/\([^/]\+\)/.*#\1#'`
#echo $VCSGIT
#echo $SALSA_GROUP
SALSA_GROUP_ID
=
$(
curl
-
-silent
-f
-XGET
--header
"PRIVATE-TOKEN:
$SALSA_TOKEN
"
"
$SALSA_URL
/groups
?all_available=false"
| jq
".[] | select(.path ==
\"
$SALSA_GROUP
\"
) |
.id
"
)
SALSA_GROUP_ID
=
$(
curl
-
s
-f
-XGET
--header
"PRIVATE-TOKEN:
$SALSA_TOKEN
"
"
$SALSA_URL
/groups
/
$SALSA_GROUP
"
| jq
'
.id
'
)
set
-x
curl
"
$SALSA_URL
/projects?private_token=
$SALSA_TOKEN
"
\
--data
"path=
${
DEBPKGNAME
}
&namespace_id=
${
SALSA_GROUP_ID
}
&description=
${
SHORTDESC
}
&visibility=public"
set
+x
git remote add origin git@salsa.debian.org:
${
SALSA_GROUP
}
/
${
DEBPKGNAME
}
.git
git push origin master
git push
--all
--set-upstream
git push
--tags
git remote add origin git@salsa.debian.org:
${
SALSA_GROUP
}
/
${
DEBPKGNAME
}
.git
git push origin master
git push
--all
--set-upstream
git push
--tags