Skip to content

Commit 65a0834

Browse files
committed
[skip ci] TVB-3135. Generate online help.
1 parent 9b05fb7 commit 65a0834

File tree

3 files changed

+41
-37
lines changed

3 files changed

+41
-37
lines changed

.github/workflows/build-docker-image.yml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,33 @@ jobs:
3333
- name: Set up Docker Buildx
3434
uses: docker/setup-buildx-action@v3
3535

36-
# - name: Login to Docker Hub
37-
# uses: docker/login-action@v3
38-
# with:
39-
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
40-
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
36+
- name: Login to Docker Hub
37+
uses: docker/login-action@v3
38+
with:
39+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
40+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
41+
42+
- name: Login to EBRAINS Docker Registry
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ${{ env.DOCKER_EBRAINS_REGISTRY }}
46+
username: ${{ secrets.EBRAINS_DOCKER_HUB_USERNAME }}
47+
password: ${{ secrets.EBRAINS_DOCKER_HUB_PASSWORD }}
4148

42-
# - name: Login to EBRAINS Docker Registry
43-
# uses: docker/login-action@v3
44-
# with:
45-
# registry: ${{ env.DOCKER_EBRAINS_REGISTRY }}
46-
# username: ${{ secrets.EBRAINS_DOCKER_HUB_USERNAME }}
47-
# password: ${{ secrets.EBRAINS_DOCKER_HUB_PASSWORD }}
49+
- name: Set up Python
50+
uses: actions/setup-python@v4
51+
with:
52+
python-version: "3.13"
53+
54+
- name: Prepare TVB online help
55+
run: |
56+
python3 -m pip install sphinx
57+
cd tvb_library
58+
python3 -m pip install -e .
59+
cd ../tvb_bin
60+
python3 -m pip install -e .
61+
cd ../tvb_build
62+
python3 build_step1.py True
4863
4964
- name: Prepare tag for Docker image
5065
# At release time, the tag will be given as input
@@ -57,18 +72,6 @@ jobs:
5772
echo "TAG=${{ github.ref_name }}.alpha" >> $GITHUB_OUTPUT
5873
fi
5974
60-
- name: set up Python
61-
uses: actions/setup-python@v4
62-
with:
63-
python-version: "3.13"
64-
65-
- name: Prepare TVB online help
66-
run: |
67-
python3 -m pip install sphinx
68-
cd tvb_build
69-
python3 build_step1.py ${{ github.ref_name }} True
70-
ls tvb_build/docker
71-
7275
- name: Build Docker image
7376
uses: docker/build-push-action@v6
7477
with:

tvb_build/Jenkinsfile-Step1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pipeline {
2828
source activate tvb-docs
2929
cd tvb_build
3030
bash install_full_tvb.sh
31-
python build_step1.py $GIT_BRANCH $GIT_PASSWORD
31+
python build_step1.py False $GIT_BRANCH $GIT_PASSWORD
3232
cd ..
3333
git commit tvb_library/tvb/basic/config/tvb.version -m "Update GIT revision number automatically from Jenkins" && git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/the-virtual-brain/tvb-root.git HEAD:${GIT_BRANCH//origin\\/} || true
3434
'''

tvb_build/build_step1.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,13 @@
4444
import requests
4545

4646
import tvb_bin
47-
import tvb_data
48-
from subprocess import Popen, PIPE
4947

5048
# source paths
5149
BIN_FOLDER = os.path.dirname(tvb_bin.__file__)
5250
TVB_ROOT = os.path.dirname(os.path.dirname(BIN_FOLDER))
5351
FW_FOLDER = os.path.join(TVB_ROOT, 'tvb_framework')
5452
LICENSE_PATH = os.path.join(FW_FOLDER, 'LICENSE')
5553
RELEASE_NOTES_PATH = os.path.join(TVB_ROOT, 'tvb_documentation', 'RELEASE_NOTES')
56-
DATA_SRC_FOLDER = os.path.dirname(tvb_data.__file__)
5754
DEMOS_MATLAB_FOLDER = os.path.join(TVB_ROOT, 'tvb_documentation', 'matlab')
5855

5956
# dest paths
@@ -117,6 +114,9 @@
117114

118115

119116
def _copy_dataset(dataset_files, dataset_destination):
117+
import tvb_data
118+
DATA_SRC_FOLDER = os.path.dirname(tvb_data.__file__)
119+
120120
for pth in dataset_files:
121121
rel_pth = pth.split('/')
122122
origin = os.path.join(DATA_SRC_FOLDER, *rel_pth)
@@ -228,7 +228,7 @@ def build_step1(only_online_help=False):
228228
if os.path.exists(DOCKER_FOLDER):
229229
shutil.rmtree(DOCKER_FOLDER)
230230
os.makedirs(DOCKER_FOLDER)
231-
shutil.move(DIST_FOLDER, DOCKER_FOLDER)
231+
shutil.move(os.path.join(DIST_FOLDER, "_help"), DOCKER_FOLDER)
232232
return
233233

234234
doc_generator.generate_pdfs()
@@ -252,16 +252,17 @@ def build_step1(only_online_help=False):
252252

253253

254254
if __name__ == '__main__':
255-
branch = None
255+
only_online_help = False
256256
if len(sys.argv) > 1:
257-
branch = sys.argv[1]
257+
only_online_help = bool(sys.argv[1])
258+
branch = None
259+
if len(sys.argv) > 2:
260+
branch = sys.argv[2]
258261
if branch.startswith("origin/"):
259262
branch = branch.replace("origin/","")
260-
# token = None
261-
# if len(sys.argv) > 2:
262-
# token = sys.argv[2]
263-
# ensure_tvb_current_revision(branch, token)
264-
only_online_help = False
265-
if len(sys.argv) > 2:
266-
only_online_help = bool(sys.argv[3])
263+
token = None
264+
if len(sys.argv) > 3:
265+
token = sys.argv[3]
266+
if token:
267+
ensure_tvb_current_revision(branch, token)
267268
build_step1(only_online_help)

0 commit comments

Comments
 (0)