parser.add_argument('destpath', type=str, help='Destination path')
parser.add_argument('--branch', type=str, help='Deploy directly from branch')
parser.add_argument('--templates', action='store_true', help='Deploy templates (except pages) and static instead of pages')
+ parser.add_argument('--githash', type=str, help='Use hash as githash instead of autodetecting')
args = parser.parse_args()
# Generate a githash file
with open(os.path.join(args.destpath, ".deploystatic_githash"), "w") as f:
- f.write(find_git_revision(args.sourcepath))
+ if args.githash:
+ f.write(args.githash)
+ else:
+ f.write(find_git_revision(args.sourcepath))
sys.exit(0)
context = load_context(source.readfile('templates/context.json'))
# Fetch the current git revision if this is coming out of a git repository
- context['githash'] = find_git_revision(args.sourcepath)
+ if args.githash:
+ context['githash'] = args.githash
+ else:
+ context['githash'] = find_git_revision(args.sourcepath)
# Load a context that can override everything, including static hashes
context.update(load_context(source.readfile('templates/context.override.json')))