Skip to content

Make it easier to build development versions using the Dockerfile #170

Description

@Kagee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions