mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2024-09-21 02:17:23 +00:00
release.sh: added script to do the release process
This does the release of the tarballs, the git tagging and the release of gitlab. Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
This commit is contained in:
parent
1c5c02b057
commit
d7b07677fe
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,6 +5,7 @@ ocserv*.tar.xz*
|
||||
*.trs
|
||||
*.gcda
|
||||
*.gcno
|
||||
.gitlab-token
|
||||
ocserv
|
||||
ocserv-worker
|
||||
configure
|
||||
|
63
release.sh
Executable file
63
release.sh
Executable file
@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "This script will send the tarballs to infradead and create tags and release at gitlab"
|
||||
echo "It will use your ssh keys and gitlab token as placed in .gitlab-token"
|
||||
echo "Press enter to continue..."
|
||||
read
|
||||
|
||||
if test -z "$1";then
|
||||
echo "usage: $0 [VERSION]"
|
||||
echo "No version was specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! test -f ".gitlab-token";then
|
||||
echo "Cannot find .gitlab-token"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PROJECT=473862
|
||||
TOKEN=$(cat .gitlab-token)
|
||||
version=$1
|
||||
file=ocserv-${version}.tar.xz
|
||||
|
||||
echo "Signing artifacts as generated by 'make dist'"
|
||||
echo "Press enter to continue or type skip to skip..."
|
||||
read s
|
||||
|
||||
if test "$s" != "s" && test "$s" != "skip";then
|
||||
gpg --sign --detach ${file}
|
||||
scp ${file}* casper.infradead.org:/var/ftp/pub/ocserv/
|
||||
fi
|
||||
|
||||
echo "Creating tag $version and gitlab release"
|
||||
echo "Press enter to continue or type skip to skip..."
|
||||
read s
|
||||
if test "$s" != "s" && test "$s" != "skip";then
|
||||
git tag -s ${version} -m "Released ${version}"
|
||||
git push origin ${version}
|
||||
fi
|
||||
|
||||
echo "Creating gitlab $version release"
|
||||
echo "Press enter to continue or type skip to skip..."
|
||||
read s
|
||||
|
||||
if test "$s" != "s" && test "$s" != "skip";then
|
||||
line=$(grep -n "Version ${version}" NEWS|cut -d ':' -f 1)
|
||||
test -z "$line" && exit 1
|
||||
|
||||
stopline="$(head -n 100 NEWS|tail -n $((100-$line))|grep -n Version|head -1|cut -d ':' -f 1)"
|
||||
test -z "$stopline" && exit 1
|
||||
|
||||
msg=$(head -n 100 NEWS|tail -n +$((1+$line))|head -n $(($stopline-1))|tr -d '"'|tr -d "'"|sed '{:q;N;s/\n/\\n/g;t q}')
|
||||
|
||||
set -e
|
||||
curl --header 'Content-Type: application/json' --header "PRIVATE-TOKEN: ${TOKEN}" \
|
||||
--data '{ "name": "'${version}'", "tag_name": "'${version}'", "description": "'"${msg}"'", "milestones": ["'${version}'"], "assets": { "links": [{ "name": "PGP signature", "url": "https://www.infradead.org/ocserv/download/ocserv-'${version}'.tar.xz.sig", "link_type":"other" }, { "name": "Tarball", "url": "https://www.infradead.org/ocserv/download/ocserv-'${version}'.tar.xz", "link_type":"other" }] } }' \
|
||||
--request POST "https://gitlab.com/api/v4/projects/${PROJECT}/releases"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo Done
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user