From 6c16aedadd93dc3ca5a71e70acabe47984f802ab Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sat, 5 Oct 2019 15:01:03 +0200 Subject: [PATCH] Merge CKAN+Datapusher and ODK+Build into respective single build directories --- build/usr/bin/lxcbuild | 12 ++++++------ .../lxc => ckan/ckan-datapusher.lxc}/bin/add-ca-cert | 0 .../lxc => ckan/ckan-datapusher.lxc}/run | 0 .../lxcfile => ckan/ckan-datapusher.lxcfile} | 2 +- lxc-apps/ckan/{lxc => ckan.lxc}/etc/crontabs/ckan | 0 .../etc/services.d/.s6-svscan/finish | 0 .../ckan/{lxc => ckan.lxc}/etc/services.d/ckan/run | 0 .../ckan/{lxc => ckan.lxc}/etc/services.d/cron/run | 0 lxc-apps/ckan/{lxcfile => ckan.lxcfile} | 0 .../etc/services.d/.s6-svscan/finish | 0 .../etc/services.d/build2xlsform/run | 0 .../etc/services.d/odkbuild/down-signal | 0 .../etc/services.d/odkbuild/run | 0 .../opendatakit-build.lxcfile} | 0 .../opendatakit/{lxcfile => opendatakit.lxcfile} | 0 lxc-apps/openmapkit/lxcfile | 3 --- 16 files changed, 7 insertions(+), 10 deletions(-) rename lxc-apps/{ckan-datapusher/lxc => ckan/ckan-datapusher.lxc}/bin/add-ca-cert (100%) mode change 100755 => 100644 rename lxc-apps/{ckan-datapusher/lxc => ckan/ckan-datapusher.lxc}/run (100%) rename lxc-apps/{ckan-datapusher/lxcfile => ckan/ckan-datapusher.lxcfile} (97%) rename lxc-apps/ckan/{lxc => ckan.lxc}/etc/crontabs/ckan (100%) rename lxc-apps/ckan/{lxc => ckan.lxc}/etc/services.d/.s6-svscan/finish (100%) rename lxc-apps/ckan/{lxc => ckan.lxc}/etc/services.d/ckan/run (100%) rename lxc-apps/ckan/{lxc => ckan.lxc}/etc/services.d/cron/run (100%) rename lxc-apps/ckan/{lxcfile => ckan.lxcfile} (100%) rename lxc-apps/{opendatakit-build/lxc => opendatakit/opendatakit-build.lxc}/etc/services.d/.s6-svscan/finish (100%) mode change 100755 => 100644 rename lxc-apps/{opendatakit-build/lxc => opendatakit/opendatakit-build.lxc}/etc/services.d/build2xlsform/run (100%) mode change 100755 => 100644 rename lxc-apps/{opendatakit-build/lxc => opendatakit/opendatakit-build.lxc}/etc/services.d/odkbuild/down-signal (100%) rename lxc-apps/{opendatakit-build/lxc => opendatakit/opendatakit-build.lxc}/etc/services.d/odkbuild/run (100%) mode change 100755 => 100644 rename lxc-apps/{opendatakit-build/lxcfile => opendatakit/opendatakit-build.lxcfile} (100%) rename lxc-apps/opendatakit/{lxcfile => opendatakit.lxcfile} (100%) diff --git a/build/usr/bin/lxcbuild b/build/usr/bin/lxcbuild index ae03087..a2673b8 100755 --- a/build/usr/bin/lxcbuild +++ b/build/usr/bin/lxcbuild @@ -9,7 +9,7 @@ from lxcbuild.image import Image parser = argparse.ArgumentParser(description='VM application builder and packager') parser.add_argument('-f', '--force', action='store_true', help='Force rebuild already built package') -parser.add_argument('buildpath', help='Either specific "lxcfile" or "meta" file or a directory containing one') +parser.add_argument('buildpath', help='Either specific "lxcfile" or "meta" file or a directory containing at least one') if len(sys.argv) < 2: parser.print_usage() @@ -30,12 +30,12 @@ if os.path.isfile(buildpath): sys.exit(1) else: valid_dir = False - lxcfile = os.path.join(buildpath, 'lxcfile') + for entry in os.scandir(buildpath): + if entry.is_file() and (entry.name == 'lxcfile' or entry.name.endswith('.lxcfile')): + valid_dir = True + image = Image(entry.path) + image.build_and_pack(args.force) meta = os.path.join(buildpath, 'meta') - if os.path.exists(lxcfile): - valid_dir = True - image = Image(lxcfile) - image.build_and_pack(args.force) if os.path.exists(meta): valid_dir = True app = App(meta) diff --git a/lxc-apps/ckan-datapusher/lxc/bin/add-ca-cert b/lxc-apps/ckan/ckan-datapusher.lxc/bin/add-ca-cert old mode 100755 new mode 100644 similarity index 100% rename from lxc-apps/ckan-datapusher/lxc/bin/add-ca-cert rename to lxc-apps/ckan/ckan-datapusher.lxc/bin/add-ca-cert diff --git a/lxc-apps/ckan-datapusher/lxc/run b/lxc-apps/ckan/ckan-datapusher.lxc/run similarity index 100% rename from lxc-apps/ckan-datapusher/lxc/run rename to lxc-apps/ckan/ckan-datapusher.lxc/run diff --git a/lxc-apps/ckan-datapusher/lxcfile b/lxc-apps/ckan/ckan-datapusher.lxcfile similarity index 97% rename from lxc-apps/ckan-datapusher/lxcfile rename to lxc-apps/ckan/ckan-datapusher.lxcfile index e1d13e1..db6a1bc 100644 --- a/lxc-apps/ckan-datapusher/lxcfile +++ b/lxc-apps/ckan/ckan-datapusher.lxcfile @@ -31,6 +31,6 @@ RUN EOF rm -rf /root/.cache EOF -COPY lxc +COPY ckan-datapusher.lxc CMD execlineb -P /run diff --git a/lxc-apps/ckan/lxc/etc/crontabs/ckan b/lxc-apps/ckan/ckan.lxc/etc/crontabs/ckan similarity index 100% rename from lxc-apps/ckan/lxc/etc/crontabs/ckan rename to lxc-apps/ckan/ckan.lxc/etc/crontabs/ckan diff --git a/lxc-apps/ckan/lxc/etc/services.d/.s6-svscan/finish b/lxc-apps/ckan/ckan.lxc/etc/services.d/.s6-svscan/finish similarity index 100% rename from lxc-apps/ckan/lxc/etc/services.d/.s6-svscan/finish rename to lxc-apps/ckan/ckan.lxc/etc/services.d/.s6-svscan/finish diff --git a/lxc-apps/ckan/lxc/etc/services.d/ckan/run b/lxc-apps/ckan/ckan.lxc/etc/services.d/ckan/run similarity index 100% rename from lxc-apps/ckan/lxc/etc/services.d/ckan/run rename to lxc-apps/ckan/ckan.lxc/etc/services.d/ckan/run diff --git a/lxc-apps/ckan/lxc/etc/services.d/cron/run b/lxc-apps/ckan/ckan.lxc/etc/services.d/cron/run similarity index 100% rename from lxc-apps/ckan/lxc/etc/services.d/cron/run rename to lxc-apps/ckan/ckan.lxc/etc/services.d/cron/run diff --git a/lxc-apps/ckan/lxcfile b/lxc-apps/ckan/ckan.lxcfile similarity index 100% rename from lxc-apps/ckan/lxcfile rename to lxc-apps/ckan/ckan.lxcfile diff --git a/lxc-apps/opendatakit-build/lxc/etc/services.d/.s6-svscan/finish b/lxc-apps/opendatakit/opendatakit-build.lxc/etc/services.d/.s6-svscan/finish old mode 100755 new mode 100644 similarity index 100% rename from lxc-apps/opendatakit-build/lxc/etc/services.d/.s6-svscan/finish rename to lxc-apps/opendatakit/opendatakit-build.lxc/etc/services.d/.s6-svscan/finish diff --git a/lxc-apps/opendatakit-build/lxc/etc/services.d/build2xlsform/run b/lxc-apps/opendatakit/opendatakit-build.lxc/etc/services.d/build2xlsform/run old mode 100755 new mode 100644 similarity index 100% rename from lxc-apps/opendatakit-build/lxc/etc/services.d/build2xlsform/run rename to lxc-apps/opendatakit/opendatakit-build.lxc/etc/services.d/build2xlsform/run diff --git a/lxc-apps/opendatakit-build/lxc/etc/services.d/odkbuild/down-signal b/lxc-apps/opendatakit/opendatakit-build.lxc/etc/services.d/odkbuild/down-signal similarity index 100% rename from lxc-apps/opendatakit-build/lxc/etc/services.d/odkbuild/down-signal rename to lxc-apps/opendatakit/opendatakit-build.lxc/etc/services.d/odkbuild/down-signal diff --git a/lxc-apps/opendatakit-build/lxc/etc/services.d/odkbuild/run b/lxc-apps/opendatakit/opendatakit-build.lxc/etc/services.d/odkbuild/run old mode 100755 new mode 100644 similarity index 100% rename from lxc-apps/opendatakit-build/lxc/etc/services.d/odkbuild/run rename to lxc-apps/opendatakit/opendatakit-build.lxc/etc/services.d/odkbuild/run diff --git a/lxc-apps/opendatakit-build/lxcfile b/lxc-apps/opendatakit/opendatakit-build.lxcfile similarity index 100% rename from lxc-apps/opendatakit-build/lxcfile rename to lxc-apps/opendatakit/opendatakit-build.lxcfile diff --git a/lxc-apps/opendatakit/lxcfile b/lxc-apps/opendatakit/opendatakit.lxcfile similarity index 100% rename from lxc-apps/opendatakit/lxcfile rename to lxc-apps/opendatakit/opendatakit.lxcfile diff --git a/lxc-apps/openmapkit/lxcfile b/lxc-apps/openmapkit/lxcfile index 5c6471e..859a09d 100644 --- a/lxc-apps/openmapkit/lxcfile +++ b/lxc-apps/openmapkit/lxcfile @@ -39,7 +39,4 @@ EOF # s6 required for single service due to inability of nodejs to process signals when running as PID 1 COPY lxc -MOUNT FILE /srv/openmapkit/conf/settings.js srv/openmapkit/settings.js -MOUNT DIR /srv/openmapkit/data srv/openmapkit/data - CMD s6-svscan /etc/services.d