Skip to content

Commit 02db7da

Browse files
Add kitspace_dev_entrypoint
1 parent 7edf46a commit 02db7da

File tree

3 files changed

+95
-4
lines changed

3 files changed

+95
-4
lines changed

.dockerignore

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,71 @@
11
Dockerfile*
22
node_modules
3+
4+
# .gitignore content
5+
.git
6+
7+
**/*.test
8+
9+
modules/migration/bindata.go
10+
modules/migration/bindata.go.hash
11+
modules/options/bindata.go
12+
modules/options/bindata.go.hash
13+
modules/public/bindata.go
14+
modules/public/bindata.go.hash
15+
modules/templates/bindata.go
16+
modules/templates/bindata.go.hash
17+
18+
**/*.db
19+
**/*.log
20+
21+
gitea
22+
gitea-vet
23+
debug
24+
integrations.test
25+
26+
bin
27+
dist
28+
custom/*
29+
!custom/conf
30+
custom/conf/*
31+
!custom/conf/app.example.ini
32+
data
33+
indexers
34+
log
35+
public/img/avatar
36+
tests/integration/gitea-integration-*
37+
tests/integration/indexers-*
38+
tests/e2e/gitea-e2e-*
39+
tests/e2e/indexers-*
40+
tests/e2e/reports
41+
tests/e2e/test-artifacts
42+
tests/e2e/test-snapshots
43+
tests/*.ini
44+
node_modules
45+
yarn.lock
46+
yarn-error.log
47+
npm-debug.log*
48+
public/js
49+
public/serviceworker.js
50+
public/css
51+
public/fonts
52+
public/img/webpack
53+
vendor
54+
web_src/fomantic/node_modules
55+
web_src/fomantic/build/*
56+
!web_src/fomantic/build/semantic.js
57+
!web_src/fomantic/build/semantic.css
58+
!web_src/fomantic/build/themes
59+
web_src/fomantic/build/themes/*
60+
!web_src/fomantic/build/themes/default
61+
web_src/fomantic/build/themes/default/assets/*
62+
!web_src/fomantic/build/themes/default/assets/fonts
63+
web_src/fomantic/build/themes/default/assets/fonts/*
64+
!web_src/fomantic/build/themes/default/assets/fonts/icons.woff2
65+
!web_src/fomantic/build/themes/default/assets/fonts/outline-icons.woff2
66+
VERSION
67+
.air
68+
.go-licenses
69+
70+
# Make evidence files
71+
.make_evidence

Dockerfile.gitea.dev

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ RUN apk --no-cache add \
3030
COPY . /go/src/code.gitea.io/gitea
3131
WORKDIR /go/src/code.gitea.io/gitea
3232

33-
#Remove .git because of -buildvcs and submodule issue
34-
RUN rm -f .git
35-
3633
RUN npm install --no-save
34+
RUN mkdir .go-licenses
3735
RUN make build
3836

3937
# Begin env-to-ini build
@@ -65,5 +63,5 @@ COPY docker/root /
6563
RUN mkdir -p /app/gitea
6664
RUN cp /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
6765
RUN cp /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
68-
RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
66+
RUN chmod 755 /usr/bin/entrypoint /usr/bin/kitspace_dev_entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
6967
RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
# This is a workaround to fix the vcs error caused by mounting the gitea source directory
3+
# into the container, in development, so we remove the `.git` dir but this will remove it
4+
# from the host manchine too. To work around this, we move `.git` dir, then build gitea, then
5+
# reset `.git` again.
6+
7+
cleanup() {
8+
# If the container gets killed before reseting the .git folder
9+
# reset it in the clean up command.
10+
[ ! -e ".git" ] && mv /tmp/git .git
11+
}
12+
13+
# Traps
14+
trap 'cleanup' SIGTERM
15+
trap 'cleanup' SIGINT
16+
trap 'cleanup' SIGQUIT
17+
18+
# Move the git folder before building and add it again.
19+
( mv .git /tmp/git && make build && mv /tmp/git .git && cp gitea /app/gitea/ && /usr/bin/entrypoint ) &
20+
21+
wait $!
22+
23+
# run the clean up procedure if the one of the commands above fails.
24+
cleanup

0 commit comments

Comments
 (0)