Skip to content

Commit 08d62e7

Browse files
committed
Merge branch 'master' of github.com:oracle/opengrok into lucene-9.10.0
2 parents 160984e + 785896c commit 08d62e7

File tree

78 files changed

+1610
-785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1610
-785
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
4+
# Maintain dependencies for GitHub Actions
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"
9+
10+
- package-ecosystem: "docker"
11+
directory: "/"
12+
schedule:
13+
interval: "weekly"

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
- name: Install Universal ctags (Windows)
4545
if: runner.os == 'Windows'
4646
run: choco install universal-ctags
47-
- name: Before build actions (Unix)
48-
if: runner.os == 'Linux' || runner.os == 'macOS'
47+
- name: Before build actions
48+
shell: bash
4949
run: ./dev/before
5050
- name: Maven build
5151
shell: bash

.github/workflows/docker.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
name: Build Docker image
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
pull_request:
6+
release:
7+
types: [created]
48

59
jobs:
610
ubuntu:
711
runs-on: ubuntu-latest
812
steps:
13+
- name: Print environment
14+
shell: bash
15+
run: env
916
- name: Checkout master branch
1017
uses: actions/checkout@v4
1118
- uses: actions/setup-python@v5
@@ -31,15 +38,13 @@ jobs:
3138
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
3239
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
3340
OPENGROK_REPO_SLUG: ${{ github.repository }}
34-
OPENGROK_PULL_REQUEST: ${{ github.head_ref }}
3541
OPENGROK_REF: ${{ github.ref }}
3642
run: ./dev/docker.sh
3743
- name: Install Python pre-requisites
3844
run: python3 -m pip install requests
3945
- name: Optionally update README on Docker hub
4046
env:
4147
OPENGROK_REPO_SLUG: ${{ github.repository }}
42-
OPENGROK_PULL_REQUEST: ${{ github.head_ref }}
4348
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
4449
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
4550
run: ./dev/dockerhub_readme.py

.github/workflows/release.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: Release
22

33
# TODO: run this only for the oracle/opengrok repository
44
on:
5-
push:
6-
tags:
7-
- '[1-9]+.[0-9]+.[0-9]+'
5+
release:
6+
types: [created]
87

98
jobs:
109
get_tag:
@@ -48,23 +47,18 @@ jobs:
4847
run: ./dev/before
4948
- name: Build
5049
run: ./mvnw -DskipTests=true -Dmaven.javadoc.skip=false -B -V package
51-
- name: Create Release
52-
id: create_release
53-
uses: actions/create-release@v1
50+
- name: Get upload URL
51+
id: get_upload_url
5452
env:
55-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56-
with:
57-
tag_name: ${{ github.ref }}
58-
release_name: ${{ github.ref }}
59-
draft: false
60-
prerelease: false
53+
OPENGROK_TAG: ${{ needs.get_tag.outputs.tag }}
54+
run: dev/get_upload_url.sh
6155
- name: Upload release tarball
6256
id: upload-release-asset
6357
uses: actions/upload-release-asset@v1
6458
env:
6559
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6660
with:
67-
upload_url: ${{ steps.create_release.outputs.upload_url }}
61+
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
6862
asset_path: ./distribution/target/opengrok-${{ needs.get_tag.outputs.tag }}.tar.gz
6963
asset_name: opengrok-${{ needs.get_tag.outputs.tag }}.tar.gz
7064
asset_content_type: application/octet-stream

Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ RUN cp `ls -t distribution/target/*.tar.gz | head -1` /opengrok.tar.gz
4141
# Store the version in a file so that the tools can report it.
4242
RUN /mvn/mvnw help:evaluate -Dexpression=project.version -q -DforceStdout > /mvn/VERSION
4343

44-
FROM tomcat:10.1.19-jdk17
44+
FROM tomcat:10.1.30-jdk17
4545
LABEL maintainer="https://github.com/oracle/opengrok"
46+
LABEL org.opencontainers.image.source="https://github.com/oracle/opengrok"
47+
LABEL org.opencontainers.image.description="OpenGrok code search"
4648

4749
# Add Perforce apt source.
4850
# hadolint ignore=DL3008,DL3009
@@ -64,11 +66,11 @@ RUN apt-get update && \
6466
# hadolint ignore=DL3008,DL3059
6567
RUN architecture=$(uname -m) && if [[ "$architecture" == "aarch64" ]]; then \
6668
echo "aarch64: do not install helix-p4d."; else \
67-
apt-get install --no-install-recommends -y helix-p4d; fi
69+
apt-get install --no-install-recommends -y helix-p4d || echo "Failed to install Perforce"; fi
6870

6971
# compile and install universal-ctags
7072
# hadolint ignore=DL3003,DL3008
71-
RUN apt-get install --no-install-recommends -y pkg-config automake build-essential && \
73+
RUN apt-get install --no-install-recommends -y pkg-config automake build-essential libxml2-dev && \
7274
git clone https://github.com/universal-ctags/ctags /root/ctags && \
7375
cd /root/ctags && ./autogen.sh && ./configure && make && make install && \
7476
apt-get remove -y automake build-essential && \
@@ -77,19 +79,17 @@ RUN apt-get install --no-install-recommends -y pkg-config automake build-essenti
7779
apt-get clean && \
7880
rm -rf /var/lib/apt/lists/*
7981

80-
# Update the Python tooling in order to successfully install the opengrok-tools package.
81-
# hadolint ignore=DL3013
82-
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools
83-
8482
# prepare OpenGrok binaries and directories
8583
# hadolint ignore=DL3010
8684
COPY --from=build opengrok.tar.gz /opengrok.tar.gz
8785
# hadolint ignore=DL3013
8886
RUN mkdir -p /opengrok /opengrok/etc /opengrok/data /opengrok/src && \
8987
tar -zxvf /opengrok.tar.gz -C /opengrok --strip-components 1 && \
9088
rm -f /opengrok.tar.gz && \
91-
python3 -m pip install --no-cache-dir /opengrok/tools/opengrok-tools.tar.gz && \
92-
python3 -m pip install --no-cache-dir Flask Flask-HTTPAuth waitress # for /reindex REST endpoint handled by start.py
89+
python3 -m venv /venv
90+
ENV PATH=/venv/bin:$PATH
91+
RUN /venv/bin/python3 -m pip install --no-cache-dir /opengrok/tools/opengrok-tools.tar.gz && \
92+
/venv/bin/python3 -m pip install --no-cache-dir Flask Flask-HTTPAuth waitress # for /reindex REST endpoint handled by start.py
9393

9494
COPY --from=build /mvn/VERSION /opengrok/VERSION
9595

dev/before_install

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ if [[ "$RUNNER_OS" == "Linux" ]]; then
2828
# Bitkeeper install failure is not critical, so exit code is not checked.
2929
sudo ./dev/install-bitkeeper.sh
3030

31-
sudo -H ./dev/install-python-packages.sh
32-
if [[ $? != 0 ]]; then
33-
echo "cannot install Python packages"
34-
exit 1
35-
fi
36-
3731
sudo ./dev/install-universal_ctags.sh
3832
if [[ $? != 0 ]]; then
3933
echo "cannot install Universal ctags"
@@ -49,15 +43,6 @@ elif [[ "$RUNNER_OS" == "macOS" ]]; then
4943
exit 1
5044
fi
5145

52-
brew install python3
53-
brew upgrade python
54-
55-
./dev/install-python-packages.sh
56-
if [[ $? != 0 ]]; then
57-
echo "cannot install Python packages"
58-
exit 1
59-
fi
60-
6146
sudo ./dev/install-universal_ctags.sh
6247
if [[ $? != 0 ]]; then
6348
echo "cannot install Universal ctags"

dev/docker.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ docker run -d $IMAGE
6262
docker ps -a
6363

6464
# This can only work on home repository since it needs encrypted variables.
65-
if [[ -n "$OPENGROK_PULL_REQUEST" ]]; then
65+
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
6666
echo "Not pushing Docker image for pull requests"
6767
exit 0
6868
fi
@@ -75,12 +75,12 @@ fi
7575

7676
if [[ -z $DOCKER_USERNAME ]]; then
7777
echo "DOCKER_USERNAME is empty, exiting"
78-
exit 0
78+
exit 1
7979
fi
8080

8181
if [[ -z $DOCKER_PASSWORD ]]; then
8282
echo "DOCKER_PASSWORD is empty, exiting"
83-
exit 0
83+
exit 1
8484
fi
8585

8686
# Publish the image to Docker hub.

dev/dockerhub_readme.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def check_push_env():
8585
logger.info("Not updating Docker hub README for non main repo")
8686
sys.exit(0)
8787

88-
pull_request = os.environ.get("OPENGROK_PULL_REQUEST")
89-
if pull_request and len(pull_request) > 0:
88+
event_type = os.environ.get("GITHUB_EVENT_NAME")
89+
if event_type and event_type == "pull_request":
9090
logger.info("Not updating Docker hub README for pull requests")
9191
sys.exit(0)
9292

dev/get_upload_url.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
#
3+
# The purpose of this script is to retrieve upload URL for OpenGrok release given by the tag
4+
# stored in the OPENGROK_TAG environment variable.
5+
# The value is stored in a special file consumed by Github action so that it can be used
6+
# to upload assets to the related OpenGrok release on Github.
7+
#
8+
9+
echo "Getting upload URL for $OPENGROK_TAG"
10+
upload_url=$( curl -s https://api.github.com/repos/oracle/opengrok/releases/tags/$OPENGROK_TAG | jq -r .upload_url )
11+
echo "Got '$upload_url'"
12+
if [[ -n $GITHUB_OUTPUT ]]; then
13+
echo "upload_url=$upload_url" >> $GITHUB_OUTPUT
14+
fi

dev/ref2tag.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

33
tag=${OPENGROK_REF#"refs/tags/"}
4-
echo "::set-output name=tag::$tag"
4+
echo "tag=$tag" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)