Skip to content
Snippets Groups Projects
Commit ebab6d60 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Always add bob.devtools to the output of changelog

parent 29b6740f
No related branches found
No related tags found
1 merge request!145Improve the release scripts
...@@ -22,41 +22,39 @@ Examples: ...@@ -22,41 +22,39 @@ Examples:
1. Generates the changelog for a single package using merge requests: 1. Generates the changelog for a single package using merge requests:
$ bdt gitlab changelog group/package.xyz changelog.md $ bdt gitlab changelog -vvv group/package.xyz changelog.md
2. The same as above, but dumps the changelog to stdout instead of a file: 2. The same as above, but dumps the changelog to stdout instead of a file:
$ bdt gitlab changelog group/package.xyz $ bdt gitlab changelog -vvv group/package.xyz
3. Generates the changelog for a single package looking at commits 3. Generates the changelog for a single package looking at commits
(not merge requests): (not merge requests):
$ bdt gitlab changelog --mode=commits group/package.xyz changelog.md $ bdt gitlab changelog -vvv --mode=commits group/package.xyz changelog.md
4. Generates the changelog for a single package looking at merge requests starting from a given date of January 1, 2016: 4. Generates the changelog for a single package looking at merge requests starting from a given date of January 1, 2016:
\b \b
$ bdt gitlab changelog --mode=mrs --since=2016-01-01 group/package.xyz changelog.md $ bdt gitlab changelog -vvv --mode=mrs --since=2016-01-01 group/package.xyz changelog.md
5. Generates a complete list of changelogs for a list of packages (one per line: 5. Generates a complete list of changelogs for a list of packages (one per line):
\b \b
$ bdt gitlab getpath bob/bob.nightlies order.txt $ bdt gitlab getpath bob/bob.nightlies order.txt
$ bdt gitlab lasttag bob/bob $ bdt gitlab lasttag bob/bob
# copy and paste date to next command # copy and paste date to next command
$ bdt gitlab changelog --since="2018-07-17 10:23:40" order.txt changelog.md $ bdt gitlab changelog -vvv --since="2018-07-17 10:23:40" order.txt changelog.md
""" """
) )
@click.argument("target") @click.argument("target")
@click.argument( @click.argument(
"changelog", "changelog",
type=click.Path( type=click.Path(exists=False, dir_okay=False, file_okay=True, writable=True),
exists=False, dir_okay=False, file_okay=True, writable=True
),
required=False, required=False,
) )
@click.option( @click.option(
...@@ -102,9 +100,9 @@ def changelog(target, changelog, group, mode, since): ...@@ -102,9 +100,9 @@ def changelog(target, changelog, group, mode, since):
an existing file containing a list of packages that will be iterated on. an existing file containing a list of packages that will be iterated on.
For each package, we will contact the Gitlab server and create a changelog For each package, we will contact the Gitlab server and create a changelog
using merge-requests (default), tags or commits since a given date. If a using merge-requests (default), tags or commits since a given date. If a
starting date is not passed, we'll use the date of the last tagged value or starting date is not passed, we'll use the date of the last tagged value or
the date of the first commit, if no tags are available in the package. the date of the first commit, if no tags are available in the package.
""" """
gl = get_gitlab_instance() gl = get_gitlab_instance()
...@@ -119,15 +117,17 @@ def changelog(target, changelog, group, mode, since): ...@@ -119,15 +117,17 @@ def changelog(target, changelog, group, mode, since):
if k.strip() and not k.strip().startswith("#") if k.strip() and not k.strip().startswith("#")
] ]
else: else:
logger.info( logger.info("Assuming %s is a package name (file does not exist)...", target)
"Assuming %s is a package name (file does not exist)...", target
)
packages = [target] packages = [target]
# if the user passed a date, convert it # if the user passed a date, convert it
if since: if since:
since = parse_date(since) since = parse_date(since)
# Since tagging packages requires bob.devtools to be tagged first. Add that to the
# list as well. Note that bob.devtools can release itself.
packages.insert(0, "bob/bob.devtools")
# iterates over the packages and dumps required information # iterates over the packages and dumps required information
for package in packages: for package in packages:
...@@ -179,7 +179,5 @@ def changelog(target, changelog, group, mode, since): ...@@ -179,7 +179,5 @@ def changelog(target, changelog, group, mode, since):
changelog_file = open(changelog, "at") changelog_file = open(changelog, "at")
# write_tags(f, use_package, last_release_date) # write_tags(f, use_package, last_release_date)
write_tags_with_commits( write_tags_with_commits(changelog_file, use_package, last_release_date, mode)
changelog_file, use_package, last_release_date, mode
)
changelog_file.flush() changelog_file.flush()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment