diff --git a/scripts/deploy.py b/scripts/deploy.py index d80f5329af..0f877ab085 100755 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -166,7 +166,7 @@ if __name__ == "__main__": ) ) parser.add_argument( - "--symlink", nargs='*', default='./config*.json', help=( + "--include", nargs='*', default='./config*.json', help=( "Symlink these files into the root of the deployed tarball. \ Useful for config files and home pages. Supports glob syntax. \ (Default: '%(default)s')" @@ -187,8 +187,8 @@ if __name__ == "__main__": deployer.symlink_paths = {} - for symlink in args.symlink: - deployer.symlink_paths.update({ os.path.basename(pth): pth for pth in glob.iglob(symlink) }) + for include in args.include: + deployer.symlink_paths.update({ os.path.basename(pth): pth for pth in glob.iglob(include) }) print("%r", (deployer.symlink_paths,)) diff --git a/scripts/redeploy.py b/scripts/redeploy.py index e10a48c008..a43fb8a117 100755 --- a/scripts/redeploy.py +++ b/scripts/redeploy.py @@ -15,6 +15,7 @@ import json, requests, tarfile, argparse, os, errno import time import traceback from urlparse import urljoin +import glob from flask import Flask, jsonify, request, abort @@ -188,15 +189,12 @@ if __name__ == "__main__": ) ) - def _raise(ex): - raise ex - - # --config config.json=../../config.json --config config.localhost.json=./localhost.json + # --include ../../config.json ./localhost.json homepages/* parser.add_argument( - "--config", action="append", dest="configs", - type=lambda kv: kv.split("=", 1) if "=" in kv else _raise(Exception("Missing =")), help=( - "A list of configs to symlink into the extracted tarball. \ - For example, --config config.json=../config.json config2.json=../test/config.json" + "--include", nargs='*', default='./config*.json', help=( + "Symlink these files into the root of the deployed tarball. \ + Useful for config files and home pages. Supports glob syntax. \ + (Default: '%(default)s')" ) ) parser.add_argument( @@ -220,7 +218,11 @@ if __name__ == "__main__": deployer = Deployer() deployer.bundles_path = args.bundles_dir deployer.should_clean = args.clean - deployer.config_locations = dict(args.configs) if args.configs else {} + + deployer.symlink_paths = {} + + for include in args.include: + deployer.symlink_paths.update({ os.path.basename(pth): pth for pth in glob.iglob(include) }) # we don't pgp-sign jenkins artifacts; instead we rely on HTTPS access to @@ -234,13 +236,13 @@ if __name__ == "__main__": deploy_tarball(args.tarball_uri, build_dir) else: print( - "Listening on port %s. Extracting to %s%s. Symlinking to %s. Jenkins URL: %s. Config locations: %s" % + "Listening on port %s. Extracting to %s%s. Symlinking to %s. Jenkins URL: %s. Include patterns: %s" % (args.port, arg_extract_path, " (clean after)" if deployer.should_clean else "", arg_symlink, arg_jenkins_url, - deployer.config_locations, + deployer.symlink_paths, ) ) app.run(host="0.0.0.0", port=args.port, debug=True)