Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: automation/target/gecko.js

Issue 29901591: Issue 7020 - publish gecko with Node.js (Closed) Base URL: https://gitlab.com/eyeo/adblockplus/adblockpluschrome/tree/6323e74d580026e3bd1e8e631fcddaf0bbaa34df
Left Patch Set: Created Oct. 15, 2018, 10:18 a.m.
Right Patch Set: Created Oct. 16, 2018, 8:41 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « automation/publish.js ('k') | package.json » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 21 matching lines...) Expand all
32 parser.addArgument(["-p", "--package"], {required: true}); 32 parser.addArgument(["-p", "--package"], {required: true});
33 parser.addArgument(["-c", "--credentials"], {required: true}); 33 parser.addArgument(["-c", "--credentials"], {required: true});
34 parser.addArgument(["-t", "--target"], {defaultValue: "dist"}); 34 parser.addArgument(["-t", "--target"], {defaultValue: "dist"});
35 }; 35 };
36 36
37 exports.run = function(args) 37 exports.run = function(args)
38 { 38 {
39 let appIdFromPython = new Promise((resolve, reject) => 39 let appIdFromPython = new Promise((resolve, reject) =>
40 { 40 {
41 exec( 41 exec(
42 "python -c \"" + 42 "python -c \"" +
kzar 2018/10/15 12:42:58 Maybe we should parse the file using JavaScript in
tlucas 2018/10/15 14:12:39 Originally, we would have to support inheritance i
kzar 2018/10/15 14:46:10 Alright, fair enough. Personally, I'd vote for jus
43 "from buildtools.chainedconfigparser import ChainedConfigParser; " + 43 "from buildtools.chainedconfigparser import ChainedConfigParser; " +
44 "p = ChainedConfigParser(); " + 44 "p = ChainedConfigParser(); " +
45 "p.read('metadata.gecko'); " + 45 "p.read('metadata.gecko'); " +
46 "print p.get('general', 'app_id_devbuild')\"", 46 "print p.get('general', 'app_id_devbuild')\"",
47 (error, stdout, stderr) => 47 (error, stdout, stderr) =>
48 { 48 {
49 if (error) 49 if (error)
50 { 50 {
51 console.error(stderr); 51 console.error(stderr);
52 reject(error); 52 reject(error);
(...skipping 17 matching lines...) Expand all
70 return signAddon({ 70 return signAddon({
71 xpiPath: args.package, 71 xpiPath: args.package,
72 version, 72 version,
73 apiKey: auth["AMO_KEY"], 73 apiKey: auth["AMO_KEY"],
74 apiSecret: auth["AMO_SECRET"], 74 apiSecret: auth["AMO_SECRET"],
75 channel: "unlisted", 75 channel: "unlisted",
76 id: appId 76 id: appId
77 }); 77 });
78 }).then(result => 78 }).then(result =>
79 { 79 {
80 // signAddon writes failure reasons directly to the shell, so we don't have
81 // to take care about logging the error messages.
80 if (!result.success) 82 if (!result.success)
81 process.exit(1); 83 process.exit(1);
kzar 2018/10/15 12:42:58 Should we instead throw an exception here, so it's
tlucas 2018/10/15 14:12:39 Sebastian also asked if we could log something her
kzar 2018/10/15 14:46:10 I see, that's a little misleading but it's not you
tlucas 2018/10/16 08:42:39 Done.
82 84
83 let fullName = result.downloadedFiles[0]; 85 let fullName = result.downloadedFiles[0];
84 let newName = path.join(args.target, path.basename(fullName)); 86 let newName = path.join(args.target, path.basename(fullName));
85 87
86 return mvFileAsync(fullName, newName, {mkdirp: true}); 88 return mvFileAsync(fullName, newName, {mkdirp: true});
87 }).catch(err => 89 }).catch(err =>
88 { 90 {
89 console.error(err); 91 console.error(err);
90 process.exit(1); 92 process.exit(1);
91 }); 93 });
92 }; 94 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld