Skip to content

Commit 75a6dcf

Browse files
committed
Add mode to force npm installation
1 parent f68480f commit 75a6dcf

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ jobs:
203203
shell: bash
204204
run: |
205205
cp plugins/plugins.default.json /opt/countly/plugins/plugins.json
206-
node /opt/countly/bin/scripts/install_plugins.js
206+
node /opt/countly/bin/scripts/install_plugins.js --force
207207
208208
- name: Run tests
209209
shell: bash

bin/scripts/install_plugins.js

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ var manager = require('../../plugins/pluginManager.js');
33
var plugins = manager.getPlugins();
44
require('../../api/utils/log').setLevel('db:write', 'mute');
55

6+
if (process.argv && process.argv.length > 2 && process.argv[2] === '--force') {
7+
process.env.FORCE_NPM_INSTALL = true;
8+
}
9+
610
if (plugins.length > 0) {
711
manager.connectToAllDatabases().then(async() => {
812
if (!manager.getConfig("api").offline_mode) {

plugins/pluginManager.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ var pluginManager = function pluginManager() {
12631263
}
12641264
var cwd = eplugin ? eplugin.rfs : path.join(__dirname, plugin);
12651265
//if we are on docker skip npm install.
1266-
if (process && process.env && process.env.COUNTLY_CONTAINER) {
1266+
if (process && process.env && process.env.COUNTLY_CONTAINER && !process.env.FORCE_NPM_INSTALL) {
12671267
console.log('Skipping on docker');
12681268
resolve(errors);
12691269
}

0 commit comments

Comments
 (0)