Skip to content

Commit

Permalink
[TASK] Fix permission issue during "ddev start"
Browse files Browse the repository at this point in the history
  • Loading branch information
ochorocho committed Jul 3, 2024
1 parent 9a8d0bd commit 4226f91
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
8 changes: 5 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

ddev-initialize:
stage: project-template-test
image: ghcr.io/ochorocho/ddev-gitlab-ci:v1.23.1
image: ghcr.io/ochorocho/ddev-gitlab-ci:v1.23
variables:
# Remove "umask 0000" usage, so DDEV has permissions on the cloned repository
# see https://docs.gitlab.com/runner/configuration/feature-flags.html#available-feature-flags
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1
services:
- name: docker:dind
when: always
script:
- sudo chown -R ddev:ddev /builds/ # Make it work without messing with the permissions
- ddev --version
# ... do things
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ ARG ddev_version
ENV DDEV_VERSION=${ddev_version}

COPY ddev-install.sh ddev-install.sh
RUN ash ddev-install.sh
RUN ash ddev-install.sh && rm ddev-install.sh
USER ddev
RUN mkcert -install
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
This image is most likely to be used within the GitLab Runner.
As of now it only tested it on gitlab.com

**GitLab CI example**: [.gitlab-ci.yml](.gitlab-ci.yml)

# Workflow - Image build

Build the image
Expand Down
5 changes: 4 additions & 1 deletion ddev-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ adduser -D ddev -g "ddev" -s /bin/bash -D ddev -h /home/ddev
echo "ddev ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ddev && chmod 0440 /etc/sudoers.d/ddev
unamearch=$(uname -m)

RED='\033[31m'
RESET='\033[0m'

# Get binary to be downloaded
case ${unamearch} in
x86_64) ARCH="amd64";
Expand All @@ -29,4 +32,4 @@ rm -Rf ddev "ddev_linux-${ARCH}.${DDEV_VERSION}.tar.gz"
# Ensure required folders exist
mkdir -p /home/ddev/.ddev/commands/host
mkdir /builds
chown -R ddev:ddev /home/ddev/.ddev/ /builds
chown -R ddev:ddev /home/ddev/.ddev/

0 comments on commit 4226f91

Please sign in to comment.