Skip to content
Snippets Groups Projects
Commit 38825573 authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

odds and ends

parent a322a403
No related branches found
No related tags found
No related merge requests found
...@@ -10,8 +10,8 @@ content: ...@@ -10,8 +10,8 @@ content:
```shell ```shell
#!/bin/bash #!/bin/bash
# Writes the short tag value to the VERSION file in the top-level directory # In the case of "git push --tags", writes the short tag value to the
# of the Git repository # VERSION file in the top level directory of the Git repository
toplevel=$(git rev-parse --show-toplevel) toplevel=$(git rev-parse --show-toplevel)
f=${toplevel}/VERSION f=${toplevel}/VERSION
...@@ -22,7 +22,7 @@ new_version=$(git describe --tags --abbrev=0) ...@@ -22,7 +22,7 @@ new_version=$(git describe --tags --abbrev=0)
if [ "$old_version" != "$new_version" ]; then if [ "$old_version" != "$new_version" ]; then
echo "$new_version" > $f echo "$new_version" > $f
git commit -am "update version to '"$new_version"'" git commit -am "update version to '"$new_version"'"
git push origin git push origin # Is required because normal push does not necessarily happen
fi fi
exit 0 exit 0
......
...@@ -19,7 +19,7 @@ def version(): ...@@ -19,7 +19,7 @@ def version():
if version: if version:
return jsonify({'version':version}) return jsonify({'version':version})
else: else:
return utils.return_error('Version unknown') return jsonify({'error':'Version unknown'})
@app.route('/update', methods=['POST']) @app.route('/update', methods=['POST'])
def update(): def update():
...@@ -29,7 +29,6 @@ def update(): ...@@ -29,7 +29,6 @@ def update():
tarball_url = req['repository']['homepage'] + '/-/archive/master/' + \ tarball_url = req['repository']['homepage'] + '/-/archive/master/' + \
req['repository']['name'] + '-master.tar' req['repository']['name'] + '-master.tar'
version = str(utils.get_version()) version = str(utils.get_version())
print(tarball_url)
with open('./LOG', 'a') as f: with open('./LOG', 'a') as f:
print(datetime.now().strftime("[%Y-%m-%d %H:%M:%S] " + version), file=f) print(datetime.now().strftime("[%Y-%m-%d %H:%M:%S] " + version), file=f)
try: try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment