diff --git a/opendatakit-build/Dockerfile b/opendatakit-build/Dockerfile deleted file mode 100644 index aa0032d..0000000 --- a/opendatakit-build/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM ruby -LABEL maintainer="Disassembler " - -RUN \ - # Install NodeJS runtime - apk --no-cache add nodejs - -RUN \ - # Install runtime dependencies - apk --no-cache add libpq - -RUN \ - # Install build dependencies for ODK Build - apk --no-cache add --virtual .deps build-base git linux-headers openjdk8-jre-base postgresql-dev \ - # Clone ODK Build - && git clone --depth 1 https://github.com/opendatakit/build /srv/opendatakit-build \ - # Install Ruby dependencies - && cd /srv/opendatakit-build \ - && bundle install --without test \ - && rake deploy:build \ - # Create OS user - && addgroup -S -g 8017 odkbuild \ - && adduser -S -u 8017 -h /srv/opendatakit-build -s /bin/false -g odkbuild -G odkbuild odkbuild \ - && chown -R odkbuild:odkbuild /srv/opendatakit-build \ - # Cleanup - && apk --no-cache del .deps \ - && find /srv/opendatakit-build -name '.git*' -exec rm -rf {} + \ - && rm -rf /root/.bundle - -RUN \ - # Install build dependencies for build2xlsform - apk --no-cache add --virtual .deps git make npm \ - # Clone build2xlsform - && git clone --depth 1 https://github.com/opendatakit/build2xlsform /srv/build2xlsform \ - && cd /srv/build2xlsform \ - && make \ - # Change ownership - && chown -R odkbuild:odkbuild /srv/build2xlsform \ - # Cleanup - && apk --no-cache del .deps \ - && find /srv/build2xlsform -name '.git*' -exec rm -rf {} + \ - && rm -rf /root/.config /root/.npm - -COPY docker/ / - -EXPOSE 8080 - -CMD ["s6-svscan", "/etc/services.d"] diff --git a/opendatakit-build/docker/etc/services.d/.s6-svscan/finish b/opendatakit-build/lxc/etc/services.d/.s6-svscan/finish similarity index 100% rename from opendatakit-build/docker/etc/services.d/.s6-svscan/finish rename to opendatakit-build/lxc/etc/services.d/.s6-svscan/finish diff --git a/opendatakit-build/docker/etc/services.d/build2xlsform/run b/opendatakit-build/lxc/etc/services.d/build2xlsform/run similarity index 100% rename from opendatakit-build/docker/etc/services.d/build2xlsform/run rename to opendatakit-build/lxc/etc/services.d/build2xlsform/run diff --git a/opendatakit-build/docker/etc/services.d/odkbuild/run b/opendatakit-build/lxc/etc/services.d/odkbuild/run similarity index 100% rename from opendatakit-build/docker/etc/services.d/odkbuild/run rename to opendatakit-build/lxc/etc/services.d/odkbuild/run diff --git a/opendatakit-build/lxcfile b/opendatakit-build/lxcfile new file mode 100644 index 0000000..2ef0bae --- /dev/null +++ b/opendatakit-build/lxcfile @@ -0,0 +1,43 @@ +IMAGE opendatakit-build +LAYER shared/alpine +LAYER shared/ruby +LAYER shared/nodejs +LAYER opendatakit-build/opendatakit-build + +FIXLAYER /usr/bin/fix-apk + +RUN EOF + # Install runtime dependencies + apk --no-cache add libpq + + # Install build dependencies + apk --no-cache add --virtual .deps build-base git linux-headers make npm openjdk8-jre-base postgresql-dev + + # Clone ODK Build + git clone --depth 1 https://github.com/opendatakit/build /srv/opendatakit-build + + # Install Ruby dependencies + cd /srv/opendatakit-build + bundle install --without test + rake deploy:build + + # Clone build2xlsform + git clone --depth 1 https://github.com/opendatakit/build2xlsform /srv/build2xlsform + cd /srv/build2xlsform + make + + # Create OS user + addgroup -S -g 8017 odkbuild + adduser -S -u 8017 -h /srv/opendatakit-build -s /bin/false -g odkbuild -G odkbuild odkbuild + chown -R odkbuild:odkbuild /srv/opendatakit-build + chown -R odkbuild:odkbuild /srv/build2xlsform + + # Cleanup + apk --no-cache del .deps + find /srv -name '.git*' -exec rm -rf {} + + rm -rf /root/.bundle /root/.config /root/.npm +EOF + +COPY lxc + +CMD /bin/s6-svscan /etc/services.d diff --git a/opendatakit-build/build.sh b/opendatakit-build/setup.sh similarity index 100% rename from opendatakit-build/build.sh rename to opendatakit-build/setup.sh diff --git a/opendatakit-build/createdb.sql b/opendatakit-build/setup/createdb.sql similarity index 100% rename from opendatakit-build/createdb.sql rename to opendatakit-build/setup/createdb.sql diff --git a/opendatakit-build/etc/init.d/opendatakit-build b/opendatakit-build/setup/etc/init.d/opendatakit-build similarity index 100% rename from opendatakit-build/etc/init.d/opendatakit-build rename to opendatakit-build/setup/etc/init.d/opendatakit-build diff --git a/opendatakit-build/srv/opendatakit-build/conf/config.yml b/opendatakit-build/setup/srv/opendatakit-build/conf/config.yml similarity index 100% rename from opendatakit-build/srv/opendatakit-build/conf/config.yml rename to opendatakit-build/setup/srv/opendatakit-build/conf/config.yml