Skip to content
Draft
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
18 changes: 17 additions & 1 deletion .github/scripts/generate_ci_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -xeuo pipefail

if [[ $# -lt 2 ]]; then
cat >&2 <<'USAGE'
Usage: generate_ci_config.sh <output_path> <base_config_yaml> [--minio] [--jupyterhub] [--weko] [--flowable] [--s3compatsigv4] [--s3compatsigv4-inst]
Usage: generate_ci_config.sh <output_path> <base_config_yaml> [--minio] [--jupyterhub] [--weko] [--flowable] [--s3compatsigv4] [--s3compatsigv4-inst] [--wiki]
USAGE
exit 1
fi
Expand All @@ -17,6 +17,7 @@ WEKO=false
FLOWABLE=false
S3COMPATSIGV4=false
S3COMPATSIGV4_INST=false
WIKI=false

for arg in "$@"; do
case "$arg" in
Expand All @@ -38,6 +39,9 @@ for arg in "$@"; do
--s3compatsigv4-inst)
S3COMPATSIGV4_INST=true
;;
--wiki)
WIKI=true
;;
*)
echo "Unknown argument: ${arg}" >&2
exit 1
Expand Down Expand Up @@ -195,4 +199,16 @@ s3compatsigv4_inst_bucket: '${S3COMPATSIGV4_INST_BUCKET}'
EOF
fi

if [[ "${WIKI}" == "true" ]]; then
cat >> "${OUTPUT}" <<'EOF'

wiki_enabled: true
EOF
else
cat >> "${OUTPUT}" <<'EOF'

wiki_enabled: false
EOF
fi

cat "${OUTPUT}"
128 changes: 125 additions & 3 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@ on:
description: 'RDMFS Docker image (default: gcr.io/nii-ap-ops/rdmfs:2026.02.1)'
required: false
default: ''
enable_wiki:
description: 'Enable Wiki feature build (builds wiki webpack bundle and OSF image with wiki JS)'
required: false
default: 'false'
type: choice
options:
- 'false'
- 'true'
wiki_repository:
description: 'RDM-wiki-frontend repository (default: RCOSDP/RDM-wiki-frontend)'
required: false
default: ''
wiki_branch:
description: 'RDM-wiki-frontend branch (default: develop)'
required: false
default: ''
test_config:
description: 'Test configuration file to use'
required: false
Expand Down Expand Up @@ -98,6 +114,7 @@ jobs:
weko_enabled: false
jupyterhub_enabled: false
flowable_enabled: false
wiki_enabled: false
- name: user-metadata
display_name: "User Tests (Metadata)"
include_admin: false
Expand All @@ -111,6 +128,7 @@ jobs:
weko_enabled: false
jupyterhub_enabled: false
flowable_enabled: false
wiki_enabled: false
- name: admin
display_name: "Admin Tests"
include_admin: true
Expand All @@ -122,6 +140,7 @@ jobs:
weko_enabled: false
jupyterhub_enabled: false
flowable_enabled: false
wiki_enabled: false
exclude_notebooks: |
テスト手順-管理者機能-ログイン可否設定.ipynb
テスト手順-管理者機能-ノード管理.ipynb
Expand Down Expand Up @@ -163,6 +182,7 @@ jobs:
weko_enabled: false
jupyterhub_enabled: false
flowable_enabled: false
wiki_enabled: false
- name: user-minio
display_name: "User Tests (MinIO)"
include_admin: false
Expand All @@ -177,6 +197,7 @@ jobs:
weko_enabled: false
jupyterhub_enabled: false
flowable_enabled: false
wiki_enabled: false
- name: admin-minio
display_name: "Admin Tests (MinIO)"
include_admin: true
Expand All @@ -190,6 +211,7 @@ jobs:
weko_enabled: false
jupyterhub_enabled: false
flowable_enabled: false
wiki_enabled: false
- name: user-weko-direct
display_name: "User Tests (WEKO Direct)"
include_admin: true
Expand All @@ -203,6 +225,7 @@ jobs:
weko_test_mode: direct
jupyterhub_enabled: false
flowable_enabled: false
wiki_enabled: false
- name: user-weko-workflow
display_name: "User Tests (WEKO Workflow)"
include_admin: true
Expand All @@ -216,6 +239,7 @@ jobs:
weko_test_mode: workflow
jupyterhub_enabled: false
flowable_enabled: false
wiki_enabled: false
- name: user-jupyterhub
display_name: "User Tests (JupyterHub)"
include_admin: false
Expand All @@ -228,6 +252,7 @@ jobs:
weko_enabled: false
jupyterhub_enabled: true
flowable_enabled: false
wiki_enabled: false
- name: user-workflow-roles
display_name: "User Tests (Flowable Roles)"
include_admin: true
Expand All @@ -241,6 +266,7 @@ jobs:
jupyterhub_enabled: false
flowable_enabled: true
workflow_test_mode: roles
wiki_enabled: false
- name: user-workflow-forms
display_name: "User Tests (Flowable Forms)"
include_admin: true
Expand All @@ -254,6 +280,7 @@ jobs:
jupyterhub_enabled: false
flowable_enabled: true
workflow_test_mode: forms
wiki_enabled: false
- name: user-workflow-batch
display_name: "User Tests (Flowable Batch)"
include_admin: true
Expand All @@ -268,6 +295,20 @@ jobs:
flowable_enabled: true
workflow_test_mode: batch
workflow_batch_project_count: 50
wiki_enabled: false
- name: user-wiki
display_name: "User Tests (Wiki)"
include_admin: false
skip_admin: true
skip_metadata: true
skip_default_storage: true
skip_login: true
skip_130mb_upload: true
minio_enabled: false
weko_enabled: false
jupyterhub_enabled: false
flowable_enabled: false
wiki_enabled: true
name: E2E ${{ matrix.test-group.display_name }}
env:
MINIO_ENABLED: ${{ matrix.test-group.minio_enabled == true && 'true' || 'false' }}
Expand All @@ -276,6 +317,7 @@ jobs:
WEKO_ENABLED: ${{ matrix.test-group.weko_enabled == true && 'true' || 'false' }}
JUPYTERHUB_ENABLED: ${{ matrix.test-group.jupyterhub_enabled == true && 'true' || 'false' }}
FLOWABLE_ENABLED: ${{ matrix.test-group.flowable_enabled == true && 'true' || 'false' }}
WIKI_ENABLED: ${{ (matrix.test-group.wiki_enabled == true || github.event.inputs.enable_wiki == 'true') && 'true' || 'false' }}
MINIO_ROOT_USER: e2eadmin
MINIO_ROOT_PASSWORD: e2epassword123
MINIO_ALIAS: ci-minio
Expand Down Expand Up @@ -671,9 +713,21 @@ jobs:
EOF
echo "WB_CUSTOM_REPO=$(grep -oP '^-\s*WB_REPOSITORY:\s*\K.*$' /tmp/pr_body.txt | head -1 | tr -d ' \r' || true)" >> $GITHUB_ENV
echo "WB_CUSTOM_BRANCH=$(grep -oP '^-\s*WB_BRANCH:\s*\K.*$' /tmp/pr_body.txt | head -1 | tr -d ' \r' || true)" >> $GITHUB_ENV

# Wiki parameters from PR body
WIKI_ENABLED_OVERRIDE=$(grep -oP '^-\s*WIKI_ENABLED:\s*\K.*$' /tmp/pr_body.txt | head -1 | tr -d ' \r' | tr '[:upper:]' '[:lower:]' || true)
WIKI_REPO_OVERRIDE=$(grep -oP '^-\s*WIKI_REPOSITORY:\s*\K.*$' /tmp/pr_body.txt | head -1 | tr -d ' \r' || true)
WIKI_BRANCH_OVERRIDE=$(grep -oP '^-\s*WIKI_BRANCH:\s*\K.*$' /tmp/pr_body.txt | head -1 | tr -d ' \r' || true)
echo "WIKI_CUSTOM_REPO=${WIKI_REPO_OVERRIDE}" >> $GITHUB_ENV
echo "WIKI_CUSTOM_BRANCH=${WIKI_BRANCH_OVERRIDE}" >> $GITHUB_ENV
if [[ "$WIKI_ENABLED_OVERRIDE" == "true" ]]; then
echo "WIKI_ENABLED=true" >> $GITHUB_ENV
fi
else
echo "WB_CUSTOM_REPO=${{ github.event.inputs.wb_repository }}" >> $GITHUB_ENV
echo "WB_CUSTOM_BRANCH=${{ github.event.inputs.wb_branch }}" >> $GITHUB_ENV
echo "WIKI_CUSTOM_REPO=${{ github.event.inputs.wiki_repository }}" >> $GITHUB_ENV
echo "WIKI_CUSTOM_BRANCH=${{ github.event.inputs.wiki_branch }}" >> $GITHUB_ENV
fi

- name: Build custom WaterButler image
Expand Down Expand Up @@ -703,6 +757,62 @@ jobs:
echo "WB_IMAGE=rdm-waterbutler:custom" >> $GITHUB_ENV
echo "Custom WaterButler image built successfully"

- name: Build Wiki bundle and OSF image
if: env.WIKI_ENABLED == 'true'
run: |
WIKI_REPO="${WIKI_CUSTOM_REPO:-RCOSDP/RDM-wiki-frontend}"
WIKI_BRANCH="${WIKI_CUSTOM_BRANCH:-develop}"
BUILD_TAG="${{ github.run_number }}"

echo "=== Building Wiki bundle from ${WIKI_REPO}@${WIKI_BRANCH} ==="

# Stage 1: Clone RDM-wiki-frontend (wiki-webpack)
git clone --depth=50 -b "${WIKI_BRANCH}" \
"https://github.com/${WIKI_REPO}.git" RDM-wiki-frontend

# Stage 2: Prepare wiki-osf (copy of RDM-osf.io + wiki-frontend merged)
cp -r RDM-osf.io wiki-osf
cp -r RDM-wiki-frontend/. wiki-osf/

# Build wiki bundle docker image (webpack runs inside container)
echo "Building wiki bundle image..."
docker build --pull -t "rdm/wiki:${BUILD_TAG}" wiki-osf/

# Extract webpack bundle from container
mkdir -p wikitemp
CONTAINER_ID=$(docker create --name "wiki-extract-${BUILD_TAG}" "rdm/wiki:${BUILD_TAG}" bash)
docker cp "${CONTAINER_ID}:/code/website/static/public/js/" wikitemp/
docker rm "${CONTAINER_ID}" || true
docker rmi "rdm/wiki:${BUILD_TAG}" || true

# Cleanup intermediate dirs to save disk space
rm -rf wiki-osf RDM-wiki-frontend

# Stage 3: Copy wiki-edit-page bundle into RDM-osf.io
JS_FILE=$(ls -rt wikitemp/js/wiki-edit-page.*.js 2>/dev/null | tail -n 1)
MAP_FILE=$(ls -rt wikitemp/js/wiki-edit-page.*.js.map 2>/dev/null | tail -n 1 || true)

if [ -z "${JS_FILE}" ]; then
echo "ERROR: wiki-edit-page.js not found in wiki container output"
ls -la wikitemp/js/ || true
exit 1
fi

echo "Copying wiki bundle: ${JS_FILE}"
cp "${JS_FILE}" RDM-osf.io/website/static/js/pages/wiki-edit-page.js
if [ -n "${MAP_FILE}" ]; then
cp "${MAP_FILE}" RDM-osf.io/website/static/js/pages/
fi
rm -rf wikitemp

# Build final OSF image with wiki bundle included
echo "Building OSF image with wiki bundle..."
OSF_WIKI_TAG="rdm-osf-wiki:${BUILD_TAG}"
docker build -t "${OSF_WIKI_TAG}" RDM-osf.io/

echo "OSF_IMAGE=${OSF_WIKI_TAG}" >> $GITHUB_ENV
echo "=== Wiki build complete. OSF_IMAGE set to: ${OSF_WIKI_TAG} ==="

- name: Create docker-compose override for NII Cloud Operation images
working-directory: RDM-osf.io
run: |
Expand Down Expand Up @@ -734,8 +844,12 @@ jobs:
echo "TLJH_RDMFS_IMAGE_OVERRIDE=$TLJH_RDMFS_IMAGE_OVERRIDE" >> $GITHUB_ENV

# Use overrides if found, otherwise defaults
# If WB_IMAGE was set by "Build custom WaterButler image" step, use it
export OSF_IMAGE="${OSF_OVERRIDE:-niicloudoperation/rdm-osf.io:latest}"
# If WIKI_ENABLED, OSF_IMAGE was already set to the wiki-built image; preserve it
if [[ "${WIKI_ENABLED}" == "true" && -n "${OSF_IMAGE}" ]]; then
export OSF_IMAGE
else
export OSF_IMAGE="${OSF_OVERRIDE:-niicloudoperation/rdm-osf.io:latest}"
fi
export EMBER_IMAGE="${EMBER_OVERRIDE:-niicloudoperation/rdm-ember-osf-web:latest}"
export CAS_IMAGE="${CAS_OVERRIDE:-niicloudoperation/rdm-cas-overlay:latest}"
export MFR_IMAGE="${MFR_OVERRIDE:-niicloudoperation/rdm-modular-file-renderer:latest}"
Expand All @@ -746,7 +860,12 @@ jobs:
fi
else
# Use workflow dispatch inputs or defaults
export OSF_IMAGE="${{ github.event.inputs.osf_image || 'niicloudoperation/rdm-osf.io:latest' }}"
# If WIKI_ENABLED, OSF_IMAGE was already set to the wiki-built image; preserve it
if [[ "${WIKI_ENABLED}" == "true" && -n "${OSF_IMAGE}" ]]; then
export OSF_IMAGE
else
export OSF_IMAGE="${{ github.event.inputs.osf_image || 'niicloudoperation/rdm-osf.io:latest' }}"
fi
export EMBER_IMAGE="${{ github.event.inputs.ember_image || 'niicloudoperation/rdm-ember-osf-web:latest' }}"
export CAS_IMAGE="${{ github.event.inputs.cas_image || 'niicloudoperation/rdm-cas-overlay:latest' }}"
export MFR_IMAGE="${{ github.event.inputs.mfr_image || 'niicloudoperation/rdm-modular-file-renderer:latest' }}"
Expand Down Expand Up @@ -1152,6 +1271,9 @@ jobs:
if [ "${S3COMPATSIGV4_INST_ENABLED}" = "true" ]; then
args+=(--s3compatsigv4-inst)
fi
if [ "${WIKI_ENABLED}" = "true" ]; then
args+=(--wiki)
fi

.github/scripts/generate_ci_config.sh "${args[@]}"
rm base_ci.config.yaml
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ reports/
erad_dummy.tsv
# Temporary link to scripts for migrations
migrations/scripts

# macOS metadata file
__MACOSX/
._*
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Wikiインポートテスト1(1回目)
これはインポートのテスト用ファイルです

## 画像付きリンク
[![](blue.png =100)](../HOME)

## 下線
これは\<u>下線です\</u>

これは\<u>*斜線および下線です*\</u>

## 文字色
これは\<span style="color: rgb(255,0,0);">文字色(赤)です\</span>

`色なしインラインコード`\<span style="color: rgb(255,0,0);">`文字色(赤)インラインコード`\</span>`色なしインラインコード`
### 見出しの\<span style="color: rgb(255,0,0);">文字色(赤)です\</span>
*斜線文字*\<span style="color:rgb(255,0,0);">*文字色(赤)です*\</span>`

## 下線と文字色
これは\<u>下線と\<span style="color: rgb(255,0,0);">文字色\</span>です\</u>


## 見出し
1. これは見出しです(1)
1. これは見出しです(2)
1. これは見出しです(3)
1. これは見出しです(4)

## 見出し
* これは見出しです(1)
* * これは見出しです(2)
* * * これは見出しです(3)
* * * * これは見出しです(4)

## 見出し複合

# これは **太字** です。

# これは *斜体* です。

# これは ~~訂正線~~です。

# これは\<u>下線付き\</u>です。

## 特殊文字
©️
®️

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading