If set VERSION to insp4, the dockerfile will still build the last tag on insp4, not HEAD, because of the git checkout line 23:
|
RUN git checkout $(git describe --abbrev=0 --tags $VERSION) |
If you patch this, compilation will still fail, because ./configure on line 29
|
RUN ./configure --prefix /inspircd --example-dir /inspircd/examples --uid 10000 --gid 10000 |
expects the --development argument if not building from a tag.
Suggestion: Implement a build arg/env DEVELOPMENT that can contain a branch name, tag name or commit hash. This takes presence over the VERSION variable, and enables development builds.
These are two ChatGPT-generated suggestions for easy-to-read logic that should do what is needed, based on if DEVELOPMENT set or not.
Set TARGET to DEVELOPMENT or VERSION, DEVELOPMENT takes presence. If is unset or empty, checkout the lates tag as usual.
RUN set -eux; \
git clone https://github.com/inspircd/inspircd.git inspircd-src; \
cd inspircd-src; \
TARGET="${DEVELOPMENT:-$VERSION}"; \
git checkout "$TARGET"; \
if [ -z "${DEVELOPMENT:-}" ]; then \
git checkout "$(git describe --abbrev=0 --tags $TARGET)"; \
fi
If DEVELOPMENT is defined and set to not the empty string, add --development to args.
RUN set -e; \
args="--prefix /inspircd --example-dir /inspircd/examples --uid 10000 --gid 10000"; \
if [ -n "${DEVELOPMENT:-}" ]; then \
args="--development $args"; \
fi; \
./configure $args
If set VERSION to insp4, the dockerfile will still build the last tag on insp4, not HEAD, because of the git checkout line 23:
docker/Dockerfile
Line 23 in 2ed880d
If you patch this, compilation will still fail, because ./configure on line 29
docker/Dockerfile
Line 29 in 2ed880d
Suggestion: Implement a build arg/env DEVELOPMENT that can contain a branch name, tag name or commit hash. This takes presence over the VERSION variable, and enables development builds.
These are two ChatGPT-generated suggestions for easy-to-read logic that should do what is needed, based on if DEVELOPMENT set or not.
Set TARGET to DEVELOPMENT or VERSION, DEVELOPMENT takes presence. If is unset or empty, checkout the lates tag as usual.
If DEVELOPMENT is defined and set to not the empty string, add --development to args.