Skip to content

Commit

Permalink
Merge pull request #594 from nextcloud/update-git-version-on-shallow-…
Browse files Browse the repository at this point in the history
…server

Fix building and running on self-hosted
  • Loading branch information
blizzz authored Sep 28, 2023
2 parents 8749f12 + 3c2780e commit 13175fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shallow-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ COPY opcache-recommended.ini /usr/local/etc/php/conf.d/

WORKDIR /var/www/html

RUN rm -rf /var/www/html
# Looks like there's an issue on self-hosted runners with fuse-overlayfs that prevents us deleting the directory directly
# so rename it first and then remove it
RUN mv /var/www/html/ /var/www/html2/ && rm -rf /var/www/html2/
RUN mkdir -p /var/www/html

RUN git clone --depth 1 https://github.com/nextcloud/server.git .
Expand Down
5 changes: 5 additions & 0 deletions shallow-server/initnc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ export BRANCH=${BRANCH:=master}
# Where we do all the work
cd /var/www/html/

# Run 'apt-get update' to unlock files. This seems neccessary on self hosted runners with fuse-overlayfs,
# otherwise git checkout will error out with 'file exists' error. Needs to be run here, doesn't work when
# done inside the Dockerfile
apt-get update

# Update code
su www-data -c "
git fetch --force --depth 1 origin $BRANCH:refs/remotes/origin/$BRANCH
Expand Down

0 comments on commit 13175fc

Please sign in to comment.