|
1 | 1 | import subprocess
|
| 2 | +import sys |
2 | 3 | from datetime import datetime
|
3 | 4 |
|
| 5 | +# when next editing this script, please introduce argparse. |
| 6 | +# do not forget, it is called in BE by .github\workflows\reusable-docker-build.yml |
| 7 | +# argparse must be introduced there. |
| 8 | +# that action also calls BE version of this script, which is different (BE: scripts/sourceversion.py). |
| 9 | +# It must also cooperate with argparse |
| 10 | + |
| 11 | +# the idea is, that this will be different on each branch, but could be possibly passed by argv/argparse |
| 12 | +RELEASE_TAG_BASE='none' |
| 13 | + |
4 | 14 | if __name__ == '__main__':
|
5 | 15 | ts = datetime.now()
|
6 |
| - print(f"timestamp: {ts}") |
| 16 | + # we have html tags, since this script ends up creating VERSION_D.html |
| 17 | + print(f"<h4>This info was generated on: <br> <strong> {ts} </strong> </h4>") |
7 | 18 |
|
8 |
| - cmd = 'git log -1 --pretty=format:"%h - %ai"' |
9 |
| - print(f">{cmd}") |
| 19 | + cmd = 'git log -1 --pretty=format:"<h4>Git hash: <br><strong> %H </strong> <br> Date of commit: <br> <strong> %ai </strong></h4>"' |
10 | 20 | subprocess.check_call(cmd, shell=True)
|
11 | 21 |
|
12 |
| - cmd = 'git status --porcelain' |
13 |
| - print(f">{cmd}:") |
14 |
| - subprocess.check_call(cmd, shell=True) |
| 22 | + # when adding argparse, this should be a bit more obvious |
| 23 | + link = sys.argv[1] + sys.argv[2] |
| 24 | + print('<br> <h4>Build run: </h4> <a href="' + link + '"> ' + link + '</a> ') |
| 25 | + |
| 26 | + link = "https://github.com/dataquest-dev/dspace-angular/releases/tag/" \ |
| 27 | + + RELEASE_TAG_BASE + "-" + datetime.now().strftime('%Y.%m.') + sys.argv[2] |
| 28 | + |
| 29 | + print('<br> <br> <h4>Release link: </h4><a href="' + link + '"> ' + link + '</a> (if it does not work, then this is not an official release instance) ') |
0 commit comments