Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 21 lines (18 sloc) 0.992 kb
#!/usr/bin/env python
import optparse
p = optparse.OptionParser()
p.add_option("--server-hostname", dest="hostname", type="string")
(opts,args) = p.parse_args()
if (type(opts.hostname) == str and opts.hostname.startswith("stage")):
# The first step of setting up site/ for publishing in a staging
# environment is substituting staging URLs for production
for path in ["index.html", "jsapi/include.js", "jsapi/trusted.js"]:
file_contents = ""
with open(path, "r") as fp:
file_contents = fp.read()
file_contents = file_contents.replace("//myapps.mozillalabs.com","//stage.myapps.mozillalabs.com")
# We'll replace the "get demo apps" link which points to apps.mozillalabs.com in
# production with a pointer to a staging version of the demo appstore
file_contents = file_contents.replace("//apps.mozillalabs.com","//stage.appstore.mozillalabs.com")
with open(path, "w+") as fp:
fp.write(file_contents)
Jump to Line
Something went wrong with that request. Please try again.