This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sign the add-on before uploading it to amazon.
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
# Help signing the add-on as "Mozilla Extension" to make it work with Firefox 57+ | ||
# More info on: | ||
# https://mana.mozilla.org/wiki/display/SVCOPS/Sign+a+Mozilla+Internal+Extension | ||
|
||
set -e | ||
|
||
export MOZ_ENV="stage" | ||
|
||
if [ $MOZ_ENV == "prod" ]; then | ||
export AWS_DEFAULT_REGION=us-west-2 | ||
else | ||
export AWS_DEFAULT_REGION=us-east-1 | ||
fi | ||
|
||
if [ -z $AWS_ACCESS_KEY_ID ]; then | ||
echo "You should set AWS_ACCESS_KEY_ID variable" | ||
exit | ||
fi | ||
|
||
if [ -z $AWS_SECRET_ACCESS_KEY ]; then | ||
echo "You should set AWS_SECRET_ACCESS_KEY variable" | ||
exit | ||
fi | ||
|
||
if [ -z $1 ] || [ ! -f $1 ]; then | ||
echo "$0 expects path to xpi file as first argument" | ||
exit | ||
fi | ||
XPI=$1 | ||
|
||
if [ ! -x $(command -v sign-xpi) ]; then | ||
echo "You should setup aws in your environment" | ||
exit | ||
fi | ||
if [ ! -x $(command -v sign-xpi) ]; then | ||
echo "You should setup sign-xpi in your environment" | ||
echo "See: https://mana.mozilla.org/wiki/display/SVCOPS/Sign+a+Mozilla+Internal+Extension" | ||
exit | ||
fi | ||
|
||
echo "Signing $XPI" | ||
sign-xpi -t mozillaextension -e $MOZENV -s net-mozaws-$MOZENV-addons-signxpi-input $XPI | ||
aws s3 cp s3://net-mozaws-$MOZENV-addons-signxpi-output/$XPI . |