Skip to content

Commit 1a19ae8

Browse files
committed
Use a different path for temp directory, which can be deleted
The containerised version defines a path for the temporary folder to be used by Gitblit. This is so that one can choose to mount a tmpfs in the container at this path. But Gitblit tries to delete the folder when it starts to make sure it is empty. This does not work when the folder path is a mount point. So instead, a folder `gitblit` inside the temporary folder is set as temp folder for Gitblit, which can be deleted and recreated. This fixes #12
1 parent a1bd2f8 commit 1a19ae8

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ s/^server.redirectToHttpsPort.*/#server.redirectToHttpsPort = true/\n\
9696
echo "filestore.storageFolder = ${gbsrv}/lfs" >> /opt/gitblit/etc/system.properties ; \
9797
echo "tickets.indexFolder = ${gbsrv}/tickets/lucene" >> /opt/gitblit/etc/system.properties ; \
9898
echo "federation.proposalsFolder = ${gbsrv}/fedproposals" >> /opt/gitblit/etc/system.properties ; \
99-
echo "server.tempFolder = ${GITBLIT_VAR}/temp" >> /opt/gitblit/etc/system.properties ; \
99+
echo "server.tempFolder = ${GITBLIT_VAR}/temp/gitblit" >> /opt/gitblit/etc/system.properties ; \
100100
echo "server.httpPort = 8080" >> /opt/gitblit/etc/system.properties ; \
101101
echo "server.httpsPort = 8443" >> /opt/gitblit/etc/system.properties ; \
102102
echo "server.redirectToHttpsPort = true" >> /opt/gitblit/etc/system.properties ; \
@@ -191,3 +191,4 @@ ENTRYPOINT ["docker-entrypoint.sh"]
191191
# 29418: SSH transport
192192
EXPOSE 8080 8443 9418 29418
193193
CMD ["gitblit"]
194+

Dockerfile.alpine

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ s/^server.redirectToHttpsPort.*/#server.redirectToHttpsPort = true/\n\
9696
echo "filestore.storageFolder = ${gbsrv}/lfs" >> /opt/gitblit/etc/system.properties ; \
9797
echo "tickets.indexFolder = ${gbsrv}/tickets/lucene" >> /opt/gitblit/etc/system.properties ; \
9898
echo "federation.proposalsFolder = ${gbsrv}/fedproposals" >> /opt/gitblit/etc/system.properties ; \
99-
echo "server.tempFolder = ${GITBLIT_VAR}/temp" >> /opt/gitblit/etc/system.properties ; \
99+
echo "server.tempFolder = ${GITBLIT_VAR}/temp/gitblit" >> /opt/gitblit/etc/system.properties ; \
100100
echo "server.httpPort = 8080" >> /opt/gitblit/etc/system.properties ; \
101101
echo "server.httpsPort = 8443" >> /opt/gitblit/etc/system.properties ; \
102102
echo "server.redirectToHttpsPort = true" >> /opt/gitblit/etc/system.properties ; \
@@ -191,3 +191,4 @@ ENTRYPOINT ["docker-entrypoint.sh"]
191191
# 29418: SSH transport
192192
EXPOSE 8080 8443 9418 29418
193193
CMD ["gitblit"]
194+

generate/Dockerfile.template

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
% #!/bin/bash
12
% #
23
% # Full fledged script that can be used with parameters
34
% #
@@ -316,7 +317,7 @@ s/^server.redirectToHttpsPort.*/#server.redirectToHttpsPort = true/\n\
316317
echo "filestore.storageFolder = ${gbsrv}/lfs" >> /opt/gitblit/etc/system.properties ; \
317318
echo "tickets.indexFolder = ${gbsrv}/tickets/lucene" >> /opt/gitblit/etc/system.properties ; \
318319
echo "federation.proposalsFolder = ${gbsrv}/fedproposals" >> /opt/gitblit/etc/system.properties ; \
319-
echo "server.tempFolder = ${GITBLIT_VAR}/temp" >> /opt/gitblit/etc/system.properties ; \
320+
echo "server.tempFolder = ${GITBLIT_VAR}/temp/gitblit" >> /opt/gitblit/etc/system.properties ; \
320321
echo "server.httpPort = 8080" >> /opt/gitblit/etc/system.properties ; \
321322
echo "server.httpsPort = 8443" >> /opt/gitblit/etc/system.properties ; \
322323
echo "server.redirectToHttpsPort = true" >> /opt/gitblit/etc/system.properties ; \
@@ -489,3 +490,4 @@ ENTRYPOINT ["docker-entrypoint.sh"]
489490
# 29418: SSH transport
490491
EXPOSE 8080 8443 9418 29418
491492
CMD ["gitblit"]
493+

generate/generate_dockerfile.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
#
23
# Full fledged script that can be used with parameters
34
#
@@ -308,7 +309,7 @@ printf "%s\n" \#\ This\ is\ not\ available\ outside\ and\ should\ not\ be\ chang
308309
printf "%s\n" \ \ \ \ echo\ \"filestore.storageFolder\ =\ \$\{gbsrv\}/lfs\"\ \>\>\ /opt/gitblit/etc/system.properties\ \;\ \\
309310
printf "%s\n" \ \ \ \ echo\ \"tickets.indexFolder\ =\ \$\{gbsrv\}/tickets/lucene\"\ \>\>\ /opt/gitblit/etc/system.properties\ \;\ \\
310311
printf "%s\n" \ \ \ \ echo\ \"federation.proposalsFolder\ =\ \$\{gbsrv\}/fedproposals\"\ \>\>\ /opt/gitblit/etc/system.properties\ \;\ \\
311-
printf "%s\n" \ \ \ \ echo\ \"server.tempFolder\ =\ \$\{GITBLIT_VAR\}/temp\"\ \>\>\ /opt/gitblit/etc/system.properties\ \;\ \\
312+
printf "%s\n" \ \ \ \ echo\ \"server.tempFolder\ =\ \$\{GITBLIT_VAR\}/temp/gitblit\"\ \>\>\ /opt/gitblit/etc/system.properties\ \;\ \\
312313
printf "%s\n" \ \ \ \ echo\ \"server.httpPort\ =\ 8080\"\ \>\>\ /opt/gitblit/etc/system.properties\ \;\ \\
313314
printf "%s\n" \ \ \ \ echo\ \"server.httpsPort\ =\ 8443\"\ \>\>\ /opt/gitblit/etc/system.properties\ \;\ \\
314315
printf "%s\n" \ \ \ \ echo\ \"server.redirectToHttpsPort\ =\ true\"\ \>\>\ /opt/gitblit/etc/system.properties\ \;\ \\
@@ -478,3 +479,4 @@ printf "%s\n" \#\ 9418:\ \ Git\ protocol\ transport
478479
printf "%s\n" \#\ 29418:\ SSH\ transport
479480
printf "%s\n" EXPOSE\ 8080\ 8443\ 9418\ 29418
480481
printf "%s\n" CMD\ \[\"gitblit\"\]
482+
printf "\n"

goss.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ file:
3535
filetype: file
3636
exists: true
3737
mode: "0644"
38-
size: 345
38+
size: 353
3939
owner: root
4040
group: root
4141

0 commit comments

Comments
 (0)