Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions ci-scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

oldpwd=$(pwd)

usage()
{
echo "Usage: $0 VERSION"
}

_onerror()
{
exitcode=$?
echo "$0: ReFrame deployment failed!"
echo "$0: command \`$BASH_COMMAND' failed (exit code: $exitcode)"
cd $oldpwd
exit $exitcode
}

trap _onerror ERR

version=$1
if [ -z $version ]; then
echo "$0: missing version number" >&2
usage
exit 1
fi

py_minor_version=$(python3 -c 'import sys; print(sys.version_info.minor)')
if [ $py_minor_version -ne 5 ]; then
echo "$0: deployment script requires Python 3.5" >&2
exit 1
fi


tmpdir=$(mktemp -d)
echo "Deploying ReFrame version $version ..."
echo "Working directory: $tmpdir ..."
cd $tmpdir
git clone https://github.com/eth-cscs/reframe.git
cd reframe
found_version=$(./reframe.py -V)
if [ $found_version -ne $version ]; then
echo "$0: version mismatch: found $found_version, but required $version" >&2
exit 1
fi

python3 -m venv venv.docs
source venv.docs/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install -r docs/requirements.txt
./test_reframe.py
git tag -a v$version -m "ReFrame $version"
git push origin --tags
make -C docs
cd ..
git clone -b gh-pages https://github.com/eth-cscs/reframe.git reframe-doc
cd reframe-doc
rsync -avz ../reframe/docs/html/ .
echo "Please visit http://localhost:8000/ and " \
"check that the documentation is fine."
echo "Press Ctrl-C to continue when ready."
python3 -m http.server
git commit -a -m "ReFrame $version documentation"
git push origin gh-pages
deactivate
cd $oldpwd
echo "Deployment was successful!"
55 changes: 55 additions & 0 deletions ci-scripts/genrelnotes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env python3

import collections
import re
import sys
import subprocess


def usage():
sys.stderr.write('Usage: %s PREV_RELEASE CURR_RELEASE\n' % sys.argv[0])


def extract_release_notes(git_output, tag):
return re.findall(r'pull request (#\d+).*\s*\[%s\] (.*)' % tag, git_output)


if __name__ == '__main__':
if len(sys.argv) < 3:
sys.stderr.write('%s: too few arguments\n' % sys.argv[0])
usage()
sys.exit(1)

prev_release, curr_release, *_ = sys.argv[1:]
try:
git_cmd = 'git log --merges v%s..v%s' % (prev_release, curr_release)
completed = subprocess.run(git_cmd.split(),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
check=True)
except subprocess.CalledProcessError as e:
sys.stderr.write('%s: git command failed: %s\n' %
(sys.argv[0], ' '.join(e.cmd)))
sys.stderr.write(e.stdout)
sys.exit(1)

titles = {
'feat': '## New features and enhancements',
'bugfix': '## Bug fixes',
'test': '## Regression tests'
}
sections = collections.OrderedDict()
for tag in ['feat', 'bugfix', 'test', 'ci', 'doc']:
title_line = titles.get(tag, '## Other')
sections.setdefault(title_line, [])
for pr, descr in extract_release_notes(completed.stdout, tag):
descr_line = '- %s (%s)' % (descr, pr)
sections[title_line].append(descr_line)

print('# ReFrame %s Release Notes' % curr_release)
for sec_title, sec_lines in sections.items():
print()
print(sec_title)
print()
print('\n'.join(sec_lines))