Skip to content

Commit c136e0b

Browse files
authored
Merge pull request #13 from phase2/NT-drupal11-support
Support Drupal 11 SQLite version
2 parents a6ea04a + c3370ec commit c136e0b

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

build.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,13 @@
33
set -ex
44

55
# Arguments: $1 CLI_VERSION
6-
docker build --build-arg CLI_VERSION=php"${1:-8.0}" -t phase2/docker-cli:php"${1:-8.0}" ./src
6+
CLI_VERSION=${1:-8.3}
7+
8+
# Install SQLite 3.x for Drupal 11 testing if CLI version >= 8.3
9+
INSTALL_SQLITE=false
10+
# Use the `bc` calculator to compare the PHP version number.
11+
if [ "$(echo "${CLI_VERSION} >= 8.3" | bc -l)" -eq 1 ]; then
12+
INSTALL_SQLITE=true
13+
fi
14+
15+
docker build --build-arg CLI_VERSION=php"$CLI_VERSION" --build-arg INSTALL_SQLITE="$INSTALL_SQLITE" -t phase2/docker-cli:php"$CLI_VERSION" ./src

src/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ FROM docksal/cli:${CLI_VERSION}
77
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
88

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

1114
# Install kubectl and helm client
1215
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" && \
@@ -39,6 +42,18 @@ RUN curl https://awscli.amazonaws.com/awscli-exe-linux-"$(uname -m)".zip -o "aws
3942
RUN wget https://github.com/mikefarah/yq/releases/download/v4.21.1/yq_linux_"$(dpkg --print-architecture)".tar.gz -O - |\
4043
tar xz && mv yq_linux_"$(dpkg --print-architecture)" /usr/bin/yq
4144

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

0 commit comments

Comments
 (0)