Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Drupal 11 SQLite version #13

Merged
merged 5 commits into from
Dec 5, 2024
Merged
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
11 changes: 10 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@
set -ex

# Arguments: $1 CLI_VERSION
docker build --build-arg CLI_VERSION=php"${1:-8.0}" -t phase2/docker-cli:php"${1:-8.0}" ./src
CLI_VERSION=${1:-8.3}

# Install SQLite 3.x for Drupal 11 testing if CLI version >= 8.3
INSTALL_SQLITE=false
# Use the `bc` calculator to compare the PHP version number.
if [ "$(echo "${CLI_VERSION} >= 8.3" | bc -l)" -eq 1 ]; then
INSTALL_SQLITE=true
fi

docker build --build-arg CLI_VERSION=php"$CLI_VERSION" --build-arg INSTALL_SQLITE="$INSTALL_SQLITE" -t phase2/docker-cli:php"$CLI_VERSION" ./src
15 changes: 15 additions & 0 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ FROM docksal/cli:${CLI_VERSION}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ARG HELM_VERSION=v2.17.0
# Args defined before the FROM directive are not available in the build stage,
# so cannot test CLI_VERSION directly here.
ARG INSTALL_SQLITE=false

# Install kubectl and helm client
RUN curl -o /usr/local/bin/kubectl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl" && \
Expand Down Expand Up @@ -39,6 +42,18 @@ RUN curl https://awscli.amazonaws.com/awscli-exe-linux-"$(uname -m)".zip -o "aws
RUN wget https://github.com/mikefarah/yq/releases/download/v4.21.1/yq_linux_"$(dpkg --print-architecture)".tar.gz -O - |\
tar xz && mv yq_linux_"$(dpkg --print-architecture)" /usr/bin/yq

# Upgrade SQLite 3.x if specified in the build args.
# @see https://www.drupal.org/project/drupal/issues/3346338
# @see https://github.com/docksal/service-cli/pull/327/files
# Need to get sqlite3 from the Debian testing repository as the default version is too old.
RUN if [ "$INSTALL_SQLITE" = "true" ]; then \
set -xe; \
echo "deb https://deb.debian.org/debian testing main" | tee /etc/apt/sources.list.d/testing.list; \
apt-get update >/dev/null; \
apt-get install -y -t testing sqlite3; \
apt-get clean; rm -rf /var/lib/apt/lists/*; \
fi

# Install expect, vim
RUN apt-get clean && \
apt update && \
Expand Down