summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorValerie R Young <spectranaut@riseup.net>2016-11-03 16:07:50 -0400
committerHolger Levsen <holger@layer-acht.org>2016-11-27 16:31:21 +0100
commitad921c88419597a922cfd7ba5536a4f6daf763b0 (patch)
tree32457b50c7b5c2034e8f7e7ab8815d6330f46974 /bin
parent68ff1feb17c9f206f6e1081b0ab27d317741c838 (diff)
downloadjenkins.debian.net-ad921c88419597a922cfd7ba5536a4f6daf763b0.tar.xz
reproducible Debian: add option to skip database connection
Signed-off-by: Mattia Rizzolo <mattia@debian.org> Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_common.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index eefef434..9cb17bbb 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -94,15 +94,12 @@ with open(os.path.join(BIN_PATH, './reproducible_pkgsets.csv'), newline='') as f
for line in csv.reader(f):
META_PKGSET.append((line[1], line[0]))
-# init the database data and connection
-DB_ENGINE = create_engine("sqlite:///" + REPRODUCIBLE_DB, connect_args={'timeout': 60})
-DB_METADATA = MetaData(DB_ENGINE) # Get all table definitions
-conn_db = DB_ENGINE.connect() # the local sqlite3 reproducible db
-
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
group.add_argument("-d", "--debug", action="store_true")
group.add_argument("-q", "--quiet", action="store_true")
+group.add_argument("--skip-database-connection", action="store_true",
+ help="skip connecting to database")
parser.add_argument("--ignore-missing-files", action="store_true",
help="useful for local testing, where you don't have all the build logs, etc..")
args, unknown_args = parser.parse_known_args()
@@ -121,6 +118,12 @@ log.addHandler(sh)
started_at = datetime.now()
log.info('Starting at %s', started_at)
+# init the database data and connection
+if not args.skip_database_connection:
+ DB_ENGINE = create_engine("sqlite:///" + REPRODUCIBLE_DB, connect_args={'timeout': 60})
+ DB_METADATA = MetaData(DB_ENGINE) # Get all table definitions
+ conn_db = DB_ENGINE.connect() # the local sqlite3 reproducible db
+
log.debug("BIN_PATH:\t" + BIN_PATH)
log.debug("BASE:\t\t" + BASE)
log.debug("DBD_URI:\t\t" + DBD_URI)