Skip to content

Commit

Permalink
Add kitspace_dev_entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulrhmnGhanem committed Sep 26, 2022
1 parent 1bc4fd1 commit dc065f4
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 4 deletions.
69 changes: 69 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,71 @@
Dockerfile*
node_modules

# .gitignore content
.git

**/*.test

modules/migration/bindata.go
modules/migration/bindata.go.hash
modules/options/bindata.go
modules/options/bindata.go.hash
modules/public/bindata.go
modules/public/bindata.go.hash
modules/templates/bindata.go
modules/templates/bindata.go.hash

**/*.db
**/*.log

gitea
gitea-vet
debug
integrations.test

bin
dist
custom/*
!custom/conf
custom/conf/*
!custom/conf/app.example.ini
data
indexers
log
public/img/avatar
tests/integration/gitea-integration-*
tests/integration/indexers-*
tests/e2e/gitea-e2e-*
tests/e2e/indexers-*
tests/e2e/reports
tests/e2e/test-artifacts
tests/e2e/test-snapshots
tests/*.ini
node_modules
yarn.lock
yarn-error.log
npm-debug.log*
public/js
public/serviceworker.js
public/css
public/fonts
public/img/webpack
vendor
web_src/fomantic/node_modules
web_src/fomantic/build/*
!web_src/fomantic/build/semantic.js
!web_src/fomantic/build/semantic.css
!web_src/fomantic/build/themes
web_src/fomantic/build/themes/*
!web_src/fomantic/build/themes/default
web_src/fomantic/build/themes/default/assets/*
!web_src/fomantic/build/themes/default/assets/fonts
web_src/fomantic/build/themes/default/assets/fonts/*
!web_src/fomantic/build/themes/default/assets/fonts/icons.woff2
!web_src/fomantic/build/themes/default/assets/fonts/outline-icons.woff2
VERSION
.air
.go-licenses

# Make evidence files
.make_evidence
6 changes: 2 additions & 4 deletions Dockerfile.gitea.dev
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ RUN apk --no-cache add \
COPY . /go/src/code.gitea.io/gitea
WORKDIR /go/src/code.gitea.io/gitea

#Remove .git because of -buildvcs and submodule issue
RUN rm -f .git

RUN npm install --no-save
RUN mkdir .go-licenses
RUN make build

# Begin env-to-ini build
Expand Down Expand Up @@ -65,5 +63,5 @@ COPY docker/root /
RUN mkdir -p /app/gitea
RUN cp /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
RUN cp /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
RUN chmod 755 /usr/bin/entrypoint /usr/bin/kitspace_dev_entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
24 changes: 24 additions & 0 deletions docker/root/usr/bin/kitspace_dev_entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
# This is a workaround to fix the vcs error caused by mounting the gitea source directory
# into the container, in development, so we remove the `.git` dir but this will remove it
# from the host manchine too. To work around this, we move `.git` dir, then build gitea, then
# reset `.git` again.

cleanup() {
# If the container gets killed before reseting the .git folder
# reset it in the clean up command.
[ ! -e ".git" ] && mv /tmp/git .git
}

# Traps
trap 'cleanup' SIGTERM
trap 'cleanup' SIGINT
trap 'cleanup' SIGQUIT

# Move the git folder before building and add it again.
( mv .git /tmp/git && make build && mv /tmp/git .git && cp gitea /app/gitea/ && /usr/bin/entrypoint ) &

wait $!

# run the clean up procedure if the one of the commands above fails.
cleanup

0 comments on commit dc065f4

Please sign in to comment.