Commit 70476767 authored by Tristan Lucas's avatar Tristan Lucas

Refs #45 - Archive latest Chrome releases

parent 530074e1
Pipeline #82093292 passed with stage
in 53 seconds
......@@ -28,6 +28,7 @@ stages:
- prepare
- build
- test
- download
.dependencies:
script: &dependencies
......@@ -73,6 +74,8 @@ stages:
paths:
- test/screenshots/
when: on_failure
except:
- schedules
.build:
extends: .pull_cache
......@@ -80,6 +83,8 @@ stages:
stage: build
only:
- master
except:
- schedules
script:
- python build.py build -t $PLATFORM
artifacts:
......@@ -116,6 +121,8 @@ prepare-dependencies:
paths:
- ./
policy: push
except:
- schedules
docs:
extends: .test_template
......@@ -144,3 +151,24 @@ test:chromium:latest:
extends: .test_template
script:
- xvfb-run -a npm run test-only -- -g 'Chromium \(latest\)'
.download:
stage: download
script:
- npm install
- npm run archive -- $EXTENSION_ID
artifacts:
paths:
- adblockpluschrome-*.crx
only:
- schedules
download:release:
extends: .download
variables:
EXTENSION_ID: "cfhdojbkjhnklbpkdaibdccddilifddb"
download:devbuild:
extends: .download
variables:
EXTENSION_ID: "ldcecbkkoecffmfljeihcmifjjdoepkn"
/*
* This file is part of Adblock Plus <https://adblockplus.org/>,
* Copyright (C) 2006-present eyeo GmbH
*
* Adblock Plus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* Adblock Plus is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
"use strict";
const fs = require("fs");
const path = require("path");
const {ArgumentParser} = require("argparse");
const request = require("request");
const CWS_URL = "https://clients2.google.com/service/update2/crx?response=redirect&prodversion=32&acceptformat=crx3&x=id%3D";
let parser = new ArgumentParser({
description: "Download an Adblock Plus build from the Chrome Web Store."
});
parser.addArgument(
"extension-id",
{help: "The id of the extension."}
);
let args = parser.parseArgs();
let url = `${CWS_URL}${args["extension-id"]}%26uc`;
request(url, (httpError, response, body) =>
{
if (httpError)
throw httpError;
if (response.statusCode != 200)
{
throw new Error("Request failed with status code " +
response.statusCode);
}
const filenamePrefix = "adblockpluschrome-";
let remoteFilename = path.basename(response.request.path);
let filename = remoteFilename.replace("extension_", filenamePrefix)
.replace(/_/g, ".");
fs.writeFile(filename, body, fsError =>
{
if (fsError)
throw fsError;
});
});
......@@ -28,6 +28,7 @@
"sign-addon": "^0.3.1"
},
"scripts": {
"archive": "node build/archive.js",
"pretest": "bash -c \"python ensure_dependencies.py\"",
"lint": "eslint *.js lib/ qunit/ ext/ test/ build/",
"test-only": "mocha",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment