From c9e90c0a0b71ad09b4fc04795044443e32bf00bb Mon Sep 17 00:00:00 2001 From: Brandt Kurowski Date: Wed, 21 May 2025 15:51:34 +0000 Subject: [PATCH 1/4] add sshd --- Dockerfile | 9 +++++++++ docker-uceap-entrypoint | 6 ++++++ 2 files changed, 15 insertions(+) create mode 100755 docker-uceap-entrypoint diff --git a/Dockerfile b/Dockerfile index a731d02..1b602cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,15 @@ # check=skip=SecretsUsedInArgOrEnv FROM ghcr.io/uceap/devcontainer-drupal:v2.3.0 + +# Install SSH server +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get install -y openssh-server \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/* \ + && echo "Port 2222" >> /etc/ssh/sshd_config.d/azure.conf +COPY docker-uceap-entrypoint /usr/local/bin/docker-uceap-entrypoint +ENTRYPOINT ["docker-uceap-entrypoint"] + ARG MYSQL_HOST ARG MYSQL_TCP_PORT ARG MYSQL_USER diff --git a/docker-uceap-entrypoint b/docker-uceap-entrypoint new file mode 100755 index 0000000..8c2e892 --- /dev/null +++ b/docker-uceap-entrypoint @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +service ssh start + +exec apache2-foreground From 593fc1312a1538099edbdc5d3a77ec76c38558a0 Mon Sep 17 00:00:00 2001 From: Brandt Kurowski Date: Wed, 21 May 2025 16:04:54 +0000 Subject: [PATCH 2/4] sshd permit root --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 1b602cb..ab98262 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ FROM ghcr.io/uceap/devcontainer-drupal:v2.3.0 RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get install -y openssh-server \ && apt-get clean -y && rm -rf /var/lib/apt/lists/* \ + && sed -i 's/#*PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config \ && echo "Port 2222" >> /etc/ssh/sshd_config.d/azure.conf COPY docker-uceap-entrypoint /usr/local/bin/docker-uceap-entrypoint ENTRYPOINT ["docker-uceap-entrypoint"] From a30ffbec0b654061187983b82e8bce3ac835c10d Mon Sep 17 00:00:00 2001 From: Brandt Kurowski Date: Wed, 21 May 2025 16:19:10 +0000 Subject: [PATCH 3/4] =?UTF-8?q?fix=20root=20login=20on=20azure=20?= =?UTF-8?q?=F0=9F=98=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ab98262..ad38e62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,9 @@ FROM ghcr.io/uceap/devcontainer-drupal:v2.3.0 RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get install -y openssh-server \ && apt-get clean -y && rm -rf /var/lib/apt/lists/* \ - && sed -i 's/#*PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config \ - && echo "Port 2222" >> /etc/ssh/sshd_config.d/azure.conf + && echo "Port 2222" >> /etc/ssh/sshd_config.d/azure.conf \ + && echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config.d/azure.conf \ + && echo 'root:Docker!' | chpasswd COPY docker-uceap-entrypoint /usr/local/bin/docker-uceap-entrypoint ENTRYPOINT ["docker-uceap-entrypoint"] From 8755f9fc484543de89d6b98dd64842193130cb95 Mon Sep 17 00:00:00 2001 From: Brandt Kurowski Date: Wed, 21 May 2025 17:10:39 +0000 Subject: [PATCH 4/4] really ugly hack to run drush --- .github/workflows/build_deploy_and_test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build_deploy_and_test.yml b/.github/workflows/build_deploy_and_test.yml index 411d473..de59925 100644 --- a/.github/workflows/build_deploy_and_test.yml +++ b/.github/workflows/build_deploy_and_test.yml @@ -323,6 +323,14 @@ jobs: app-name: ${{ env.AZURE_WEBAPP_NAME }} publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} images: 'ghcr.io/${{ env.REPO }}-azure:${{ github.sha }}' + - name: Drush deploy + run: | + az webapp create-remote-connection \ + --resource-group drupal-example-stirred-dove \ + --name drupal-example-precious-seasnail \ + --port 16385 & + sleep 30 + sshpass -pDocker\! ssh root@127.0.0.1 -m hmac-sha1 -p 16385 -o "StrictHostKeyChecking no" /var/www/vendor/bin/drush deploy e2e_test: name: Feature tests