This is an automated email from the ASF dual-hosted git repository. petko pushed a commit to branch local-image-update in repository https://gitbox.apache.org/repos/asf/openoffice-devtools.git
commit 19e92f40d4e89bb2d03e7d3ae12b220a9c963aaa Author: Peter Kovacs <[email protected]> AuthorDate: Sun Dec 7 19:37:23 2025 +0100 update config that works updated the scripts for seting int up. --- images/opengrok/docker-compose.yaml | 9 ++--- images/opengrok/opengrok.service | 15 ++++++++ images/opengrok/scripts/fix-worktrees | 50 +++++++++++++++++++++++++ images/opengrok/scripts/reset-index | 6 +++ images/opengrok/scripts/setup-seperate-projects | 41 ++++++++++++++++++++ 5 files changed, 116 insertions(+), 5 deletions(-) diff --git a/images/opengrok/docker-compose.yaml b/images/opengrok/docker-compose.yaml index 5c1e2e9..a096852 100644 --- a/images/opengrok/docker-compose.yaml +++ b/images/opengrok/docker-compose.yaml @@ -5,7 +5,7 @@ services: #image: opengrok/docker:latest image: opengrok/docker:1.14.3 ports: - - "127.0.0.1:8080:8080" # Maps host port 8080 to container port 8080 (where OpenGrok's web interface runs) + - "127.0.0.1:8002:8080" # Maps host port 8080 to container port 8080 (where OpenGrok's web interface runs) volumes: # Mount your source code directory here. Replace ./src with the actual path to your source code. # OpenGrok will index all subdirectories within this path. @@ -27,10 +27,9 @@ services: - "/etc/localtime:/etc/localtime:ro" environment: # These are default and usually good enough, but illustrate: - #- OPENGROK_PROJECTS=AOO41XX # Optional: Name your project - - OPENGROK_WEBAPP_CONTEXT=/opengrok/src # Webapp path + # - OPENGROK_PROJECTS=AOO41X:AOO42X:trunk # Optional: Name your project + - OPENGROK_WEBAPP_CONTEXT=/ # Webapp path - OPENGROK_REFRESH_INTERVAL=1440 # Indexing interval in minutes (daily) - - OPENGROK_CSS_DIR=/opengrok/custom-styles - READONLY_CONFIG_FILE=/opengrok/etc/read-only.xml #- OPENGROK_WEBAPP_NOINDEX=false # Allow indexing via API #- OPENGROK_AUTH_REQUIRED=false # Disable auth requirement @@ -38,7 +37,7 @@ services: # This tells OpenGrok to index everything under /opengrok/src # and put the index data in /opengrok/data. # The '--sync' or '--scan-repositories' (newer) argument helps with VCS detection. - - INDEXER_OPT=-s /opengrok/src -d /opengrok/data -H -P -S -v + - INDEXER_OPT=-s /opengrok/src -d /opengrok/data -H -P -S -G -v -t 4 # How often OpenGrok should synchronize and re-index repositories (in minutes). # Set to 0 to disable automatic synchronization. - SYNC_PERIOD_MINUTES=60 diff --git a/images/opengrok/opengrok.service b/images/opengrok/opengrok.service new file mode 100644 index 0000000..89e924c --- /dev/null +++ b/images/opengrok/opengrok.service @@ -0,0 +1,15 @@ +[Unit] +Description=OpenGrok Service for Apache OpenOffice code review +Requires=docker.service +After=docker.service + +[Service] +Type=oneshot +RemainAfterExit=yes +WorkingDirectory=/x1/opengrok-prod +ExecStart=/usr/bin/docker compose up -d +ExecStop=/usr/bin/docker compose down +TimeoutStartSec=0 + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/images/opengrok/scripts/fix-worktrees b/images/opengrok/scripts/fix-worktrees new file mode 100644 index 0000000..66ef58c --- /dev/null +++ b/images/opengrok/scripts/fix-worktrees @@ -0,0 +1,50 @@ +#!/bin/bash +# fix-worktrees.sh + +REPO_URL="https://github.com/apache/openoffice.git" # Replace with actual URL +SRC_DIR="/x1/opengrok/src" # e.g., /x1/opengrok/src +BRANCHES=("trunk" "AOO41X" "AOO42X") # First one is the main branch + +cd "${SRC_DIR}" + +# Clone or verify main repository +if [ ! -d "trunk" ]; then + echo "Cloning main repository..." + git clone -b trunk "${REPO_URL}" trunk +fi + +cd trunk + +# Remove any existing worktrees that might be broken +git worktree prune + +# Create worktrees for other branches +for branch in "${BRANCHES[@]}"; do + if [ "$branch" != "trunk" ]; then + if [ -d "../${branch}" ]; then + echo "Removing existing ${branch} directory..." + rm -rf "../${branch}" + fi + + echo "Creating worktree for ${branch}..." + git worktree add "../${branch}" "${branch}" + fi +done + +cd .. + +# Verify structure +echo "" +echo "=== Directory Structure ===" +ls -la + +echo "" +echo "=== Worktree List ===" +cd trunk && git worktree list + +echo "" +echo "=== Each Directory Contents ===" +for branch in "${BRANCHES[@]}"; do + echo "--- ${branch} ---" + ls -la "${branch}/" | head -5 +done diff --git a/images/opengrok/scripts/reset-index b/images/opengrok/scripts/reset-index new file mode 100644 index 0000000..25a2af3 --- /dev/null +++ b/images/opengrok/scripts/reset-index @@ -0,0 +1,6 @@ +#!/bin/bash + + +opengrok_data=/x1/opengrok-test/data +# delete the data dir +rm -r ${opengrok_data}/* \ No newline at end of file diff --git a/images/opengrok/scripts/setup-seperate-projects b/images/opengrok/scripts/setup-seperate-projects new file mode 100644 index 0000000..05570dc --- /dev/null +++ b/images/opengrok/scripts/setup-seperate-projects @@ -0,0 +1,41 @@ +#!/bin/bash +# setup-separate-repos.sh + +REPO_URL="https://github.com/apache/openoffice.git" # Replace with actual URL +SRC_DIR="/x1/opengrok/src" # e.g., /x1/opengrok/src +BRANCHES=("trunk" "AOO41X" "AOO42X") # First one is the main branch + +cd "${SRC_DIR}" + +# Remove any existing worktrees +if [ -d "trunk" ]; then + cd trunk + git worktree prune + cd .. +fi + +# Clone each branch separately +for branch in "${BRANCHES[@]}"; do + DIR_NAME="${branch}" + + if [ -d "${DIR_NAME}" ]; then + echo "Updating ${DIR_NAME}..." + cd "${DIR_NAME}" + git fetch --all + git checkout "${branch}" + git pull + cd .. + else + echo "Cloning ${branch} into ${DIR_NAME}..." + git clone -b "${branch}" --single-branch "${REPO_URL}" "${DIR_NAME}" + fi + + # Verify it's a real repository + echo "Checking ${DIR_NAME}..." + ls -la "${DIR_NAME}/.git/" | head -5 +done + +echo "" +echo "=== Setup Complete ===" +echo "Repositories created:" +ls -d */
