5fc43455d4110f082332197f35e8713a8869ee0b
2 # SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
3 # SPDX-FileCopyrightText: 2020 EfficiOS Inc.
8 # invoke with do-release 2.N.M, or 2.N.M-rcXX
10 # Default maintainer values
11 SRCDIR
="${HOME}/git/lttng-modules"
12 # The output files are created in ${HOME}/stable/
13 OUTPUTDIR
="${HOME}/stable"
18 echo "Usage: do-release.sh [OPTION]... RELEASE"
20 echo "Mandatory arguments to long options are mandatory for short options too."
21 echo " -s, --srcdir DIR source directory"
22 echo " -o, --outputdir DIR output directory, must exist"
23 echo " -n, --no-sign don't GPG sign the output archive"
24 echo " -v, --verbose verbose command output"
53 # Catch unknown arguments
65 set -- "${POS_ARGS[@]}"
69 if [ x
"${REL}" = x
"" ]; then
74 echo "Doing LTTng modules release ${REL}"
75 echo " Source dir: ${SRCDIR}"
76 echo " Output dir: ${OUTPUTDIR}"
77 echo " GPG sign: ${SIGN}"
79 # Make sure the output directory exists
80 if [ ! -d "${OUTPUTDIR}" ]; then
81 echo "Output directory '${OUTPUTDIR}' doesn't exist."
85 # Make sure the source directory is a git repository
86 if [ ! -r "${SRCDIR}/.git/config" ]; then
87 echo "Source directory '${SRCDIR}' isn't a git repository."
91 # Set the git repo directory for all further git commands
92 export GIT_DIR
="${SRCDIR}/.git/"
94 # Check if the release tag exists
95 if ! git rev-parse
"refs/tags/v${REL}" >/dev
/null
2>&1; then
96 echo "Release tag 'v${REL}' doesn't exist."
100 # Generate the compressed tar archive, the git attributes from the tag will be used.
101 git archive
$VERBOSE --format=tar --prefix="lttng-modules-${REL}/" "v${REL}" | bzip2 > "${OUTPUTDIR}/lttng-modules-${REL}.tar.bz2"
103 pushd "${OUTPUTDIR}" >/dev
/null
104 # Generate the hashes
105 md5sum "lttng-modules-${REL}.tar.bz2" > "lttng-modules-${REL}.tar.bz2.md5"
106 sha256sum
"lttng-modules-${REL}.tar.bz2" > "lttng-modules-${REL}.tar.bz2.sha256"
108 if [ "x${SIGN}" = "xyes" ]; then
109 # Sign with the default key
110 gpg
--armor -b "lttng-modules-${REL}.tar.bz2"
This page took 0.035062 seconds and 5 git commands to generate.