Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2449 from mozilla-services/rename-id
Browse files Browse the repository at this point in the history
Rename addon id
  • Loading branch information
jaredhirsch committed Mar 21, 2017
2 parents 81212c5 + 4c7b1ab commit b84c2e4
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 52 deletions.
3 changes: 1 addition & 2 deletions .gitignore
@@ -1,7 +1,6 @@
/Profile
.DS_Store
pageshot.xpi
pageshot.update.rdf
screenshots.xpi
*.pyc
dist
dist-production
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -6,7 +6,7 @@ COPY build/static /app/build/static
COPY build/shared /app/build/shared
COPY node_modules /app/node_modules
COPY bin/_run-docker /app/bin/
COPY build/pageshot.xpi /app/build/xpi/pageshot.xpi
COPY build/screenshots.xpi /app/build/xpi/screenshots.xpi
RUN cd app && npm install

CMD /app/bin/_run-docker
14 changes: 5 additions & 9 deletions Makefile
Expand Up @@ -7,10 +7,6 @@ VENV := .venv
# Sets $(SCREENSHOTS_BACKEND) to http://localhost:10080 only if it isn't set
SCREENSHOTS_BACKEND ?= http://localhost:10080

# This forces bin/build-scripts/write_ga_id to be run before anything else, which
# writes the configured Google Analytics ID to build/ga-id.txt
_dummy := $(shell ./bin/build-scripts/write_ga_id)

# Here we have source/dest variables for many files and their destinations;
# we use these each to enumerate categories of source files, and translate
# them into the destination locations. These destination locations are the
Expand Down Expand Up @@ -95,7 +91,7 @@ build/%.html: %.html
addon: npm set_backend set_sentry addon/webextension/manifest.json addon/install.rdf addon_locales addon/webextension/build/shot.js addon/webextension/build/inlineSelectionCss.js addon/webextension/build/raven.js addon/webextension/build/defaultSentryDsn.js

EXPORT_MC_LOCATION := $(shell echo $${EXPORT_MC_LOCATION-../gecko})
GIT_EXPORT_DIR := $(EXPORT_MC_LOCATION)/browser/extensions/pageshot
GIT_EXPORT_DIR := $(EXPORT_MC_LOCATION)/browser/extensions/screenshots
DIST_EXPORT_DIR := addon

ifeq ($(shell uname -s),Linux)
Expand Down Expand Up @@ -126,15 +122,15 @@ export_addon: addon
zip: addon
# FIXME: should remove web-ext-artifacts/*.zip first
./node_modules/.bin/web-ext build --source-dir addon/webextension/
mv web-ext-artifacts/firefox_screenshots*.zip build/pageshot.zip
mv web-ext-artifacts/firefox_screenshots*.zip build/screenshots.zip
# We'll try to remove this directory, but it's no big deal if we can't:
@rmdir web-ext-artifacts || true

.PHONY: signed_xpi
signed_xpi: addon
rm -f web-ext-artifacts/*.xpi
./node_modules/.bin/web-ext sign --api-key=${AMO_USER} --api-secret=${AMO_SECRET} --source-dir addon/webextension/
mv web-ext-artifacts/*.xpi build/pageshot.xpi
mv web-ext-artifacts/*.xpi build/screenshots.xpi

.PHONY: addon_locales
addon_locales:
Expand Down Expand Up @@ -252,7 +248,7 @@ all: addon server

.PHONY: clean
clean:
rm -rf build/ addon/webextension/build/ addon/webextension/manifest.json addon/webextension/_locales/
rm -rf build/ addon/webextension/build/ addon/webextension/manifest.json addon/install.rdf addon/webextension/_locales/

.PHONY: distclean
distclean: clean
Expand All @@ -272,7 +268,7 @@ help:
@echo " make clean"
@echo " rm -rf build/ addon/webextension/build"
@echo " make zip"
@echo " make a zip of the webextension in build/pageshot.zip"
@echo " make a zip of the webextension in build/screenshots.zip"
@echo "See also:"
@echo " bin/run-addon"
@echo " bin/run-server"
8 changes: 4 additions & 4 deletions addon/bootstrap.js
Expand Up @@ -2,11 +2,11 @@

const OLD_ADDON_PREF_NAME = "extensions.jid1-NeEaf3sAHdKHPA@jetpack.deviceIdInfo";
const OLD_ADDON_ID = "jid1-NeEaf3sAHdKHPA@jetpack";
const ADDON_ID = "pageshot@mozilla.org";
const ADDON_ID = "screenshots@mozilla.org";
const TELEMETRY_PREF = "toolkit.telemetry.enabled";
const PREF_BRANCH = "extensions.pageshot.";
const USER_DISABLE_PREF = "extensions.pageshot.disabled";
const SYSTEM_DISABLE_PREF = "extensions.pageshot.system-disabled";
const PREF_BRANCH = "extensions.screenshots.";
const USER_DISABLE_PREF = "extensions.screenshots.disabled";
const SYSTEM_DISABLE_PREF = "extensions.screenshots.system-disabled";

const { interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/AddonManager.jsm");
Expand Down
2 changes: 1 addition & 1 deletion addon/install.rdf.template
Expand Up @@ -2,7 +2,7 @@
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>pageshot@mozilla.org</em:id>
<em:id>screenshots@mozilla.org</em:id>
<em:name>Firefox Screenshots</em:name>
<em:targetApplication>
<Description>
Expand Down
2 changes: 1 addition & 1 deletion addon/webextension/manifest.json.template
Expand Up @@ -7,7 +7,7 @@
"homepage_url": "https://github.com/mozilla-services/pageshot",
"applications": {
"gecko": {
"id": "pageshot@mozilla.org"
"id": "screenshots@mozilla.org"
}
},
"default_locale": "en_US",
Expand Down
2 changes: 1 addition & 1 deletion bin/build-docker-image
Expand Up @@ -24,7 +24,7 @@ rm Dockerrun.aws.json Dockerrun.aws.json.tmp

make server

xpi="build/pageshot.xpi"
xpi="build/screenshots.xpi"
if [[ ! -e "$xpi" ]] ; then
make signed_xpi
fi
Expand Down
25 changes: 0 additions & 25 deletions bin/build-scripts/write_ga_id

This file was deleted.

2 changes: 1 addition & 1 deletion bin/export_mc.py
Expand Up @@ -151,7 +151,7 @@ def main(server, mcRepoPath, mcSubDir, mcBranch, mcBaseCommit, commitMessage,
help="A gecko directory reference to mozilla-central, can also "
"be specified via EXPORT_MC_LOCATION environment variable")
parser.add_argument("--mozilla-central-subdir",
default="browser/extensions/pageshot/",
default="browser/extensions/screenshots/",
help="Where the extension is located in mozilla-central.")
parser.add_argument("-b", "--branch",
required=True,
Expand Down
7 changes: 4 additions & 3 deletions bin/release-version
Expand Up @@ -38,8 +38,9 @@ case "$channel" in
echo "Please set \$DOCKER_USERNAME to your dockerhub username"
exit 3
fi
rm -f build/pageshot.zip
rm -f build/screenshots.zip
# Forces update of the add-on version:
mkdir -p build
touch build/.backend.txt
SCREENSHOTS_BACKEND=https://pageshot.dev.mozaws.net SCREENSHOTS_SENTRY="$dev_sentry" make zip
./bin/build-docker-image $DOCKER_USERNAME
Expand All @@ -52,7 +53,7 @@ case "$channel" in
echo " git checkout stable ; git pull"
exit 4
fi
rm -f build/pageshot.zip
rm -f build/screenshots.zip
# Forces update of the add-on version:
touch build/.backend.txt
SCREENSHOTS_BACKEND=https://pageshot.stage.mozaws.net SCREENSHOTS_SENTRY="$stage_sentry" make zip
Expand All @@ -69,7 +70,7 @@ case "$channel" in
# FIXME: we shouldn't add a timestamp onto the end of the version here
SCREENSHOTS_MINOR_VERSION=0 SCREENSHOTS_BACKEND=https://pageshot.net SCREENSHOTS_SENTRY="$prod_sentry" make signed_xpi
echo
echo "Prod xpi created, email build/pageshot.xpi to wclouser@mozilla.com"
echo "Prod xpi created, email build/screenshots.xpi to wclouser@mozilla.com"
;;
*)
echo "Unknown channel: $channel"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -67,7 +67,7 @@
},
"scripts": {
"lint": "npm-run-all lint:*",
"lint:addon": "make zip && addons-linter ./build/pageshot.zip -o text",
"lint:addon": "make zip && addons-linter ./build/screenshots.zip -o text",
"lint:flake8": "make flake8",
"lint:js": "eslint .",
"lint:sass": "sass-lint -v -q",
Expand Down
2 changes: 1 addition & 1 deletion static/homepage/install-test-local.html
Expand Up @@ -14,7 +14,7 @@
<h1>Dev Firefox Screenshots</h1>
<div>This installs a copy of the add-on that points at this instance of the Screenshots server.</div>
<div>
<a href="/xpi/pageshot.xpi">Install</a>
<a href="/xpi/screenshots.xpi">Install</a>
</div>
</center>
</body>
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Expand Up @@ -7,7 +7,7 @@ const webdriver = require("selenium-webdriver");
//const Fs = require("fs-promise");
const path = require("path");

const SHOOTER_BUTTON_ID = "pageshot_mozilla_org-browser-action";
const SHOOTER_BUTTON_ID = "screenshots_mozilla_org-browser-action";

function addAddonToDriver(driver, location) {
return driver.executeAsyncScript(`
Expand Down Expand Up @@ -57,7 +57,7 @@ function getDriver() {
const driver = builder.build();

driver.setContext(firefox.Context.CHROME);
let fileLocation = path.join(process.cwd(), "build", "pageshot.zip");
let fileLocation = path.join(process.cwd(), "build", "screenshots.zip");
addAddonToDriver(driver, fileLocation);
return driver;
}
Expand Down

0 comments on commit b84c2e4

Please sign in to comment.