Skip to content

Commit

Permalink
Fix addon-linter error in dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Mar 6, 2018
1 parent 79085d6 commit e9f77f7
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions ci/update-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ MANIFEST=add-on/manifest.json
# restore original (make this script immutable)
git checkout $MANIFEST

# Switch to self-hosted dev-build for Firefox (https://github.com/ipfs-shipyard/ipfs-companion/issues/385)
DEV_BUILD_ADDON_ID="ipfs-companion-dev-build@ci.ipfs.team"
UPDATE_URL="https://ipfs-shipyard.github.io/ipfs-companion/ci/firefox/update.json"


# Use jq for JSON operations
function set-manifest {
jq -M --indent 2 "$1" < $MANIFEST > tmp.json && mv tmp.json $MANIFEST
Expand All @@ -34,12 +29,18 @@ BUILD_VERSION=$(($COMMITS_IN_MASTER*10+$NEW_COMMITS_IN_CURRENT_BRANCH))
set-manifest ".version = (.version + \".${BUILD_VERSION}\")"
grep \"version\" $MANIFEST


## Set ADD-ON ID
set-manifest ".applications.gecko[\"id\"] = \"$DEV_BUILD_ADDON_ID\""
grep ipfs-companion-dev-build $MANIFEST

## Add UPDATE_URL
set-manifest ".applications.gecko[\"update_url\"] = \"$UPDATE_URL\""
grep update_url $MANIFEST

# addon-linter throws error on 'update_url' so it is disabled in dev build
# and needs to be manually opted-in when beta build is run
if [ "$1" == "firefox-beta" ]; then
# Switch to self-hosted dev-build for Firefox (https://github.com/ipfs-shipyard/ipfs-companion/issues/385)
DEV_BUILD_ADDON_ID="ipfs-companion-dev-build@ci.ipfs.team"
UPDATE_URL="https://ipfs-shipyard.github.io/ipfs-companion/ci/firefox/update.json"

## Set ADD-ON ID
set-manifest ".applications.gecko[\"id\"] = \"$DEV_BUILD_ADDON_ID\""
grep ipfs-companion-dev-build $MANIFEST

## Add UPDATE_URL
set-manifest ".applications.gecko[\"update_url\"] = \"$UPDATE_URL\""
grep update_url $MANIFEST
fi

0 comments on commit e9f77f7

Please sign in to comment.