Skip to content

Commit

Permalink
adding json build
Browse files Browse the repository at this point in the history
  • Loading branch information
pattersonbl2 committed Apr 2, 2024
1 parent 4094f6f commit de6b4dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions bin/build-version-json.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

echo "$(dirname $0)"
cd $(dirname $0)/..

HASH=$(git --no-pager log --format=format:"%H" -1)
TAG=$(git describe --tags)

printf '{"commit":"%s","version":"%s","source":"https://github.com/mozilla/extension-workshop"}\n' \
"$HASH" \
"$TAG" \
> version.json

cat version.json
4 changes: 3 additions & 1 deletion bin/gcs-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ set -ex
CSPSTATIC="x-goog-meta-content-security-policy: default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors: 'none'; object-src 'none'"
CSP="x-goog-meta-content-security-policy: default-src 'none'; img-src 'self' data:; form-action 'self' https://www.mozilla.org/en-US/newsletter/; media-src 'self' blob:; script-src 'self' https://www.youtube.com/iframe_api https://www.youtube.com/s/player/ 'sha256-vqFvYKh0rwFP9fSa0PuzUff2ElHQ+rkjGfycqUNqufQ=' https://www.googletagmanager.com/gtag/js ; font-src 'self'; frame-ancestors 'none'; frame-src https://www.youtube.com/embed/ https://calendar.google.com/calendar/appointments/; base-uri 'none'; style-src 'self' 'unsafe-inline'; connect-src 'self' https://blog.mozilla.org/addons/feed/ https://www.mozilla.org/en-US/newsletter/ https://*.google-analytics.com;"
ACAO="x-goog-meta-access-control-allow-origin: *"

if [ -z "$EXTENSION_WORKSHOP_BUCKET_GCS" ]; then
echo "The GCS bucket is not set. Failing."
exit 1
fi


[ -e version.json ] || $(dirname $0)/build-version-json.sh

if [ -e version.json ]; then
mv version.json dist/__version__
Expand Down

0 comments on commit de6b4dc

Please sign in to comment.