2023-09-14 15:07:11 +00:00
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
const PARAMS_PATH = '/tmp/pipeline-parameters.json';
|
|
|
|
|
|
|
|
const content = JSON.parse(fs.readFileSync(PARAMS_PATH, 'utf-8'));
|
|
|
|
|
|
|
|
// Choose resource class for linux hosts
|
|
|
|
const currentBranch = process.env.CIRCLE_BRANCH || '';
|
|
|
|
content['large-linux-executor'] = /^pull\/[0-9-]+$/.test(currentBranch) ? '2xlarge' : 'electronjs/aks-linux-large';
|
2023-09-19 10:12:14 +00:00
|
|
|
content['medium-linux-executor'] = /^pull\/[0-9-]+$/.test(currentBranch) ? 'medium' : 'electronjs/aks-linux-medium';
|
2023-09-14 15:07:11 +00:00
|
|
|
|
|
|
|
fs.writeFileSync(PARAMS_PATH, JSON.stringify(content));
|