Skip to content

Commit 1dbf014

Browse files
committed
Pull excerpts from Armbian Jira
1 parent 11df3fb commit 1dbf014

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "Pull from Armbian Jira"
2+
on:
3+
schedule:
4+
- cron: '*/5 * * * *'
5+
workflow_dispatch:
6+
7+
concurrency:
8+
group: redirector
9+
cancel-in-progress: false
10+
11+
jobs:
12+
jira:
13+
runs-on: ubuntu-24.04
14+
name: "Get from Jira"
15+
steps:
16+
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
path: armbian.github.io
22+
23+
- name: setup python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: 3.8 #install the python needed
27+
28+
- name: "Run script"
29+
run: |
30+
pip install jira
31+
./armbian.github.io/scripts/pull-from-jira.py
32+
33+
- name: Commit changes if any
34+
run: |
35+
36+
cd armbian.github.io
37+
git checkout data
38+
mkdir -p data/
39+
mv ${{ github.workspace }}/jira-current.html data/
40+
mv ${{ github.workspace }}/jira-next.html data/
41+
git config --global user.name "github-actions"
42+
git config --global user.email "[email protected]"
43+
git add data/.
44+
git diff --cached --quiet || git commit -m "Update WEB indes files"
45+
git push

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ It prepares several data exchange files.
1919
| Extract and store information about base-files. | <a href=https://github.com/armbian/armbian.github.io/actions/workflows/generate-base-files-info-json.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/generate-base-files-info-json.yml?logo=githubactions&label=Status&style=for-the-badge&branch=main"></a> |
2020
| Compare all mirrors content and generate redirector configs | <a href=https://github.com/armbian/armbian.github.io/actions/workflows/generate-redirector-config.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/generate-redirector-config.yml?logo=githubactions&label=Status&style=for-the-badge&branch=main"></a> |
2121
|Update download JSON index|<a href=https://github.com/armbian/armbian.github.io/actions/workflows/generate-web-index.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/generate-web-index.yml?logo=githubactions&label=Status&style=for-the-badge&branch=main"></a>|
22+
|Pull excerpts from Armbian Jira|<a href=https://github.com/armbian/armbian.github.io/actions/workflows/generate-jira-excerpt.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/armbian.github.io/generate-jira-excerpt.yml?logo=githubactions&label=Status&style=for-the-badge&branch=main"></a>|

scripts/pull-from-jira.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/usr/bin/env python3
2+
#
3+
# automatic displaying of what is assigned to fixversion
4+
# for current and next release
5+
6+
from jira import JIRA
7+
jira = JIRA('https://armbian.atlassian.net')
8+
9+
from datetime import datetime
10+
month = datetime.now().strftime('%m')
11+
year = datetime.now().year
12+
13+
def icons(arg):
14+
if str(arg) == "Bug":
15+
return ("<img alt='Bug' src=https://armbian.atlassian.net/images/icons/issuetypes/bug.svg width=24>")
16+
if str(arg) == "Task":
17+
return ("<img alt='Task' src=https://armbian.atlassian.net/images/icons/issuetypes/task.svg width=24>")
18+
if str(arg) == "Story":
19+
return ("<img alt='Story' src=https://armbian.atlassian.net/images/icons/issuetypes/story.svg width=24>")
20+
if str(arg) == "Epic":
21+
return ("<img alt=Epic'' src=https://armbian.atlassian.net/images/icons/issuetypes/epic.svg width=24>")
22+
23+
if ( month <= "12" ):
24+
current_year=year+1
25+
current_month="02"
26+
next_month="05"
27+
next_year=year+1
28+
29+
if ( month <= "11" ):
30+
current_year=year
31+
current_month="11"
32+
next_month="02"
33+
next_year=year+1
34+
35+
if ( month <= "08" ):
36+
current_year=year
37+
current_month="08"
38+
next_month="11"
39+
next_year=year
40+
41+
if ( month <= "05" ):
42+
current_year=year
43+
current_month="05"
44+
next_month="08"
45+
next_year=year
46+
47+
if ( month <= "02" ):
48+
current_year=year
49+
current_month="02"
50+
next_month="05"
51+
next_year=year
52+
53+
# current
54+
f = open("jira-current.html", "w")
55+
current=str(current_year)[2:]+"."+current_month
56+
f.write('<div style="color: #ccc;">\n<h1 style="color: #ccc;">Should be completed in '+current+'</h1>Sorted by priority<p>\n</div>\n')
57+
f.write('<div style="color: #ccc;">\n<h5 style="color: #ccc;"><a href=https://github.com/armbian/build/pulls?q=is%3Apr+is%3Aopen+label%3A%22Needs+review%22+and+label%3A%22'+current_month+'%22>Check if you can review code that already waits at Pull reqests</a></h5>\n</div>\n')
58+
f.write('<div class="icon-menu">\n')
59+
for issue in jira.search_issues('project=AR and fixVersion="'+current+'" and status!="Done" and status!="Closed" order by Priority', maxResults=100):
60+
f.write('\n<a class="icon-menu__link" href=https://armbian.atlassian.net/browse/{}>{} {}: {}, <i>Assigned to: {}</i></a>'.format(issue.key, icons(issue.fields.issuetype), issue.fields.issuetype, issue.fields.summary, issue.fields.assignee ))
61+
f.write('\n</div>\n');
62+
f.close()
63+
64+
# next
65+
f = open("jira-next.html", "w")
66+
next=str(next_year)[2:]+"."+next_month
67+
f.write('\n<div style="color: #ccc;">\n<h1 style="color: #ccc;">Planned for '+next+' and further</h1>Sorted by priority<p></div>\n<div class="icon-menu">')
68+
for issue in jira.search_issues('project=AR and fixVersion="'+next+'" and status!="Done" and status!="Closed" order by priority desc', maxResults=100):
69+
f.write('\n<a class="icon-menu__link" href=https://armbian.atlassian.net/browse/{}>{} {}: {}, <i>Assigned to: {}</i></a>'.format(issue.key, icons(issue.fields.issuetype), issue.fields.issuetype, issue.fields.summary, issue.fields.assignee))
70+
f.write('\n</div>\n');
71+
f.close()

0 commit comments

Comments
 (0)