2018-10-03 14:02:29 +00:00
|
|
|
const fs = require('../../core/fs.js');
|
2018-08-30 12:13:37 +00:00
|
|
|
const path = require('path');
|
2018-05-07 18:30:30 +00:00
|
|
|
const async = require('async');
|
2018-10-03 14:02:29 +00:00
|
|
|
const utils = require('../../utils/utils.js');
|
|
|
|
const ProcessLauncher = require('../../core/processes/processLauncher');
|
|
|
|
const constants = require('../../constants');
|
2018-10-11 11:19:27 +00:00
|
|
|
const WebpackConfigReader = require('../pipeline/webpackConfigReader');
|
2016-08-21 16:02:02 +00:00
|
|
|
|
2017-03-30 11:12:39 +00:00
|
|
|
class Pipeline {
|
2018-10-03 14:02:29 +00:00
|
|
|
constructor(embark, options) {
|
|
|
|
this.env = embark.config.env;
|
|
|
|
this.buildDir = embark.config.buildDir;
|
|
|
|
this.contractsFiles = embark.config.contractsFiles;
|
|
|
|
this.assetFiles = embark.config.assetFiles;
|
|
|
|
this.events = embark.events;
|
|
|
|
this.logger = embark.config.logger;
|
|
|
|
this.plugins = embark.config.plugins;
|
2018-08-16 20:51:34 +00:00
|
|
|
this.webpackConfigName = options.webpackConfigName;
|
2018-05-10 14:48:06 +00:00
|
|
|
this.pipelinePlugins = this.plugins.getPluginsFor('pipeline');
|
2018-10-04 09:40:52 +00:00
|
|
|
this.pipelineConfig = embark.config.pipelineConfig;
|
2018-08-31 20:02:42 +00:00
|
|
|
this.isFirstBuild = true;
|
2018-09-13 13:07:14 +00:00
|
|
|
|
2018-10-11 11:19:27 +00:00
|
|
|
this.events.setCommandHandler('pipeline:build', (options, callback) => this.build(options, callback));
|
2018-09-13 13:07:14 +00:00
|
|
|
fs.removeSync(this.buildDir);
|
2018-04-17 21:35:00 +00:00
|
|
|
|
|
|
|
let plugin = this.plugins.createPlugin('deployment', {});
|
|
|
|
plugin.registerAPICall(
|
|
|
|
'get',
|
2018-08-30 12:13:37 +00:00
|
|
|
'/embark-api/file',
|
2018-04-17 21:35:00 +00:00
|
|
|
(req, res) => {
|
2018-08-30 12:13:37 +00:00
|
|
|
if (!fs.existsSync(req.query.path) || !req.query.path.startsWith(fs.dappPath())) {
|
|
|
|
return res.send({error: 'Path is invalid'});
|
|
|
|
}
|
|
|
|
const name = path.basename(req.query.path);
|
|
|
|
const content = fs.readFileSync(req.query.path, 'utf8');
|
|
|
|
res.send({name, content, path: req.query.path});
|
|
|
|
|
2018-04-17 21:35:00 +00:00
|
|
|
}
|
|
|
|
);
|
2018-08-27 02:49:01 +00:00
|
|
|
|
|
|
|
plugin.registerAPICall(
|
2018-08-30 12:13:37 +00:00
|
|
|
'post',
|
|
|
|
'/embark-api/files',
|
2018-08-27 02:49:01 +00:00
|
|
|
(req, res) => {
|
2018-08-30 12:13:37 +00:00
|
|
|
try {
|
|
|
|
this.apiGuardBadFile(req.body.path);
|
|
|
|
} catch (error) {
|
|
|
|
return res.send({error: error.message});
|
|
|
|
}
|
|
|
|
|
|
|
|
fs.writeFileSync(req.body.path, req.body.content, { encoding: 'utf8'});
|
|
|
|
const name = path.basename(req.body.path);
|
|
|
|
res.send({name, path: req.body.path, content: req.body.content});
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
plugin.registerAPICall(
|
|
|
|
'delete',
|
|
|
|
'/embark-api/file',
|
|
|
|
(req, res) => {
|
|
|
|
try {
|
|
|
|
this.apiGuardBadFile(req.query.path);
|
|
|
|
} catch (error) {
|
|
|
|
return res.send({error: error.message});
|
|
|
|
}
|
|
|
|
fs.removeSync(req.query.path);
|
|
|
|
res.send();
|
2018-08-27 02:49:01 +00:00
|
|
|
}
|
|
|
|
);
|
2018-08-30 12:13:37 +00:00
|
|
|
|
|
|
|
plugin.registerAPICall(
|
|
|
|
'get',
|
2018-08-30 12:13:37 +00:00
|
|
|
'/embark-api/files',
|
2018-08-30 12:13:37 +00:00
|
|
|
(req, res) => {
|
2018-08-30 12:13:37 +00:00
|
|
|
const rootPath = fs.dappPath();
|
|
|
|
const walk = (dir, filelist = []) => fs.readdirSync(dir).map(name => {
|
|
|
|
let isRoot = rootPath === dir;
|
|
|
|
if (fs.statSync(path.join(dir, name)).isDirectory()) {
|
|
|
|
return { isRoot, name, dirname: dir, children: walk(path.join(dir, name), filelist)};
|
2018-08-30 12:13:37 +00:00
|
|
|
}
|
2018-08-30 12:13:37 +00:00
|
|
|
return {name, isRoot, path: path.join(dir, name), dirname: dir};
|
2018-08-30 12:13:37 +00:00
|
|
|
});
|
|
|
|
const files = walk(fs.dappPath());
|
|
|
|
res.send(files);
|
|
|
|
}
|
|
|
|
);
|
2017-03-30 11:12:39 +00:00
|
|
|
}
|
2017-01-15 19:30:41 +00:00
|
|
|
|
2018-08-30 12:13:37 +00:00
|
|
|
apiGuardBadFile(pathToCheck) {
|
|
|
|
const dir = path.dirname(pathToCheck);
|
|
|
|
if (!fs.existsSync(pathToCheck) || !dir.startsWith(fs.dappPath())) {
|
|
|
|
throw new Error('Path is invalid');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-16 23:29:53 +00:00
|
|
|
build({modifiedAssets}, callback) {
|
2017-03-30 11:12:39 +00:00
|
|
|
let self = this;
|
2018-05-08 13:36:50 +00:00
|
|
|
const importsList = {};
|
2018-05-22 05:15:34 +00:00
|
|
|
let placeholderPage;
|
2017-06-27 22:18:29 +00:00
|
|
|
|
2018-10-03 14:02:29 +00:00
|
|
|
if (!self.assetFiles || !Object.keys(self.assetFiles).length) {
|
2018-09-28 17:22:03 +00:00
|
|
|
return self.buildContracts(callback);
|
2018-07-07 13:51:24 +00:00
|
|
|
}
|
|
|
|
|
2018-05-08 13:36:50 +00:00
|
|
|
async.waterfall([
|
2018-10-03 14:02:29 +00:00
|
|
|
function createPlaceholderPage(next) {
|
2018-09-04 13:20:27 +00:00
|
|
|
if (self.isFirstBuild) {
|
|
|
|
self.isFirstBuild = false;
|
|
|
|
return next();
|
2018-08-31 20:02:42 +00:00
|
|
|
}
|
2018-09-04 13:20:27 +00:00
|
|
|
self.events.request('build-placeholder', next);
|
2018-05-22 05:15:34 +00:00
|
|
|
},
|
2018-10-03 14:02:29 +00:00
|
|
|
(next) => self.buildContracts(next),
|
|
|
|
(next) => self.buildWeb3JS(next),
|
2018-05-08 13:36:50 +00:00
|
|
|
function createImportList(next) {
|
|
|
|
importsList["Embark/EmbarkJS"] = fs.dappPath(".embark", 'embark.js');
|
|
|
|
importsList["Embark/web3"] = fs.dappPath(".embark", 'web3_instance.js');
|
2018-05-21 11:43:36 +00:00
|
|
|
importsList["Embark/contracts"] = fs.dappPath(".embark/contracts", '');
|
2017-06-27 22:18:29 +00:00
|
|
|
|
2018-10-03 14:02:29 +00:00
|
|
|
self.plugins.getPluginsProperty('imports', 'imports').forEach(importObject => {
|
2018-05-08 13:36:50 +00:00
|
|
|
let [importName, importLocation] = importObject;
|
|
|
|
importsList[importName] = importLocation;
|
|
|
|
});
|
|
|
|
next();
|
|
|
|
},
|
2018-08-16 20:57:38 +00:00
|
|
|
function writeContracts(next) {
|
2018-06-08 11:07:27 +00:00
|
|
|
self.events.request('contracts:list', (_err, contracts) => {
|
2018-05-21 11:43:36 +00:00
|
|
|
// ensure the .embark/contracts directory exists (create if not exists)
|
2018-10-03 14:02:29 +00:00
|
|
|
fs.mkdirp(fs.dappPath(".embark/contracts", ''), err => {
|
2018-05-21 11:43:36 +00:00
|
|
|
if(err) return next(err);
|
2018-05-22 02:11:45 +00:00
|
|
|
|
|
|
|
// Create a file .embark/contracts/index.js that requires all contract files
|
|
|
|
// Used to enable alternate import syntax:
|
|
|
|
// e.g. import {Token} from 'Embark/contracts'
|
|
|
|
// e.g. import * as Contracts from 'Embark/contracts'
|
|
|
|
let importsHelperFile = fs.createWriteStream(fs.dappPath(".embark/contracts", 'index.js'));
|
|
|
|
importsHelperFile.write('module.exports = {\n');
|
|
|
|
|
|
|
|
async.eachOf(contracts, (contract, idx, eachCb) => {
|
2018-10-03 14:02:29 +00:00
|
|
|
self.events.request('code-generator:contract', contract.className, contractCode => {
|
2018-05-21 11:43:36 +00:00
|
|
|
let filePath = fs.dappPath(".embark/contracts", contract.className + '.js');
|
|
|
|
importsList["Embark/contracts/" + contract.className] = filePath;
|
|
|
|
fs.writeFile(filePath, contractCode, eachCb);
|
2018-05-22 02:11:45 +00:00
|
|
|
|
|
|
|
// add the contract to the exports list to support alternate import syntax
|
|
|
|
importsHelperFile.write(`"${contract.className}": require('./${contract.className}').default`);
|
|
|
|
if(idx < contracts.length - 1) importsHelperFile.write(',\n'); // add a comma if we have more contracts to add
|
2018-05-21 11:43:36 +00:00
|
|
|
});
|
2018-10-03 14:02:29 +00:00
|
|
|
}, () => {
|
2018-08-16 20:57:38 +00:00
|
|
|
importsHelperFile.write('\n}'); // close the module.exports = {}
|
2018-05-22 02:11:45 +00:00
|
|
|
importsHelperFile.close(next); // close the write stream
|
2018-05-16 16:48:17 +00:00
|
|
|
});
|
2018-05-21 11:43:36 +00:00
|
|
|
});
|
2018-05-16 16:48:17 +00:00
|
|
|
});
|
2018-05-08 13:36:50 +00:00
|
|
|
},
|
2018-10-11 11:19:27 +00:00
|
|
|
function shouldRunWebpack(next){
|
|
|
|
// assuming we got here because an asset was changed, let's check our webpack config
|
|
|
|
// to see if the changed asset requires webpack to run
|
2018-10-19 05:03:56 +00:00
|
|
|
if(!(modifiedAssets && modifiedAssets.length)) return next(null, false);
|
|
|
|
const configReader = new WebpackConfigReader({webpackConfigName: self.webpackConfigName});
|
|
|
|
return configReader.readConfig((err, config) => {
|
|
|
|
if(err) return next(err);
|
2018-10-11 11:19:27 +00:00
|
|
|
|
2018-10-19 05:03:56 +00:00
|
|
|
if (typeof config !== 'object' || config === null) {
|
|
|
|
return next(__('bad webpack config, the resolved config was null or not an object'));
|
|
|
|
}
|
2018-10-11 11:19:27 +00:00
|
|
|
|
2018-10-19 05:03:56 +00:00
|
|
|
const shouldRun = modifiedAssets.some(modifiedAsset => config.module.rules.some(rule => rule.test.test(modifiedAsset)));
|
|
|
|
return next(null, !shouldRun);
|
|
|
|
});
|
2018-10-11 11:19:27 +00:00
|
|
|
},
|
|
|
|
function runWebpack(shouldNotRun, next) {
|
|
|
|
if(shouldNotRun) return next();
|
2018-08-16 22:01:21 +00:00
|
|
|
self.logger.info(__(`running webpack with '${self.webpackConfigName}' config...`));
|
2018-10-03 14:02:29 +00:00
|
|
|
const assets = Object.keys(self.assetFiles).filter(key => key.match(/\.js$/));
|
2018-09-05 15:38:09 +00:00
|
|
|
if (!assets || !assets.length) {
|
|
|
|
return next();
|
|
|
|
}
|
2018-09-05 15:47:53 +00:00
|
|
|
assets.forEach(key => {
|
|
|
|
self.logger.info(__("writing file") + " " + (utils.joinPath(self.buildDir, key)).bold.dim);
|
|
|
|
});
|
2018-08-16 20:58:19 +00:00
|
|
|
let built = false;
|
|
|
|
const webpackProcess = new ProcessLauncher({
|
|
|
|
modulePath: utils.joinPath(__dirname, 'webpackProcess.js'),
|
|
|
|
logger: self.logger,
|
|
|
|
events: self.events,
|
2018-10-03 14:02:29 +00:00
|
|
|
exitCallback: code => {
|
2018-08-16 20:58:19 +00:00
|
|
|
if (!built) {
|
|
|
|
return next(`Webpack build exited with code ${code} before the process finished`);
|
|
|
|
}
|
|
|
|
if (code) {
|
2018-08-20 18:38:04 +00:00
|
|
|
self.logger.error(__('Webpack build process exited with code ', code));
|
2018-08-16 20:58:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2018-10-04 09:40:52 +00:00
|
|
|
webpackProcess.send({
|
|
|
|
action: constants.pipeline.init,
|
|
|
|
options: {
|
|
|
|
webpackConfigName: self.webpackConfigName,
|
|
|
|
pipelineConfig: self.pipelineConfig
|
|
|
|
}
|
|
|
|
});
|
2018-08-16 20:58:19 +00:00
|
|
|
webpackProcess.send({action: constants.pipeline.build, assets: self.assetFiles, importsList});
|
|
|
|
|
|
|
|
webpackProcess.once('result', constants.pipeline.built, (msg) => {
|
|
|
|
built = true;
|
|
|
|
webpackProcess.kill();
|
|
|
|
return next(msg.error);
|
|
|
|
});
|
|
|
|
},
|
2018-05-08 13:36:50 +00:00
|
|
|
function assetFileWrite(next) {
|
2018-08-16 21:00:06 +00:00
|
|
|
async.eachOf(
|
2018-08-17 21:48:43 +00:00
|
|
|
// assetFileWrite should not process .js files
|
|
|
|
Object.keys(self.assetFiles)
|
2018-09-05 15:47:53 +00:00
|
|
|
.filter(key => !key.match(/\.js$/))
|
2018-08-17 21:48:43 +00:00
|
|
|
.reduce((obj, key) => {
|
|
|
|
obj[key] = self.assetFiles[key];
|
|
|
|
return obj;
|
|
|
|
}, {}),
|
2018-08-16 21:00:06 +00:00
|
|
|
function (files, targetFile, cb) {
|
2018-08-20 19:07:53 +00:00
|
|
|
const isDir = targetFile.slice(-1) === '/' || targetFile.slice(-1) === '\\' || targetFile.indexOf('.') === -1;
|
2018-08-16 20:59:41 +00:00
|
|
|
// if it's not a directory
|
|
|
|
if (!isDir) {
|
2018-08-17 17:41:07 +00:00
|
|
|
self.logger.info(__("writing file") + " " + (utils.joinPath(self.buildDir, targetFile)).bold.dim);
|
2018-08-16 20:59:41 +00:00
|
|
|
}
|
2018-08-16 21:00:06 +00:00
|
|
|
async.map(
|
|
|
|
files,
|
2018-05-08 13:36:50 +00:00
|
|
|
function (file, fileCb) {
|
2018-05-10 14:10:09 +00:00
|
|
|
self.logger.trace("reading " + file.filename);
|
2018-10-03 14:02:29 +00:00
|
|
|
return file.content(fileContent => {
|
2018-08-17 21:48:43 +00:00
|
|
|
self.runPlugins(file, fileContent, fileCb);
|
2018-05-08 13:36:50 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
function (err, contentFiles) {
|
|
|
|
if (err) {
|
2018-05-08 21:49:46 +00:00
|
|
|
self.logger.error(__('errors found while generating') + ' ' + targetFile);
|
2018-05-08 13:36:50 +00:00
|
|
|
}
|
|
|
|
let dir = targetFile.split('/').slice(0, -1).join('/');
|
2018-08-17 17:41:07 +00:00
|
|
|
self.logger.trace("creating dir " + utils.joinPath(self.buildDir, dir));
|
|
|
|
fs.mkdirpSync(utils.joinPath(self.buildDir, dir));
|
2018-05-08 13:02:46 +00:00
|
|
|
|
2018-05-08 13:36:50 +00:00
|
|
|
// if it's a directory
|
2018-08-16 20:59:41 +00:00
|
|
|
if (isDir) {
|
2018-05-08 13:36:50 +00:00
|
|
|
let targetDir = targetFile;
|
2018-05-08 13:02:46 +00:00
|
|
|
|
2018-05-08 13:36:50 +00:00
|
|
|
if (targetDir.slice(-1) !== '/') {
|
|
|
|
targetDir = targetDir + '/';
|
2018-05-08 13:25:37 +00:00
|
|
|
}
|
2018-05-08 13:04:53 +00:00
|
|
|
|
2018-08-20 18:39:45 +00:00
|
|
|
async.each(contentFiles, function (file, eachCb) {
|
2018-05-08 13:36:50 +00:00
|
|
|
let filename = file.filename.replace(file.basedir + '/', '');
|
2018-08-17 17:41:07 +00:00
|
|
|
self.logger.info("writing file " + (utils.joinPath(self.buildDir, targetDir, filename)).bold.dim);
|
2018-05-08 13:25:37 +00:00
|
|
|
|
2018-08-20 18:39:45 +00:00
|
|
|
fs.copy(file.path, utils.joinPath(self.buildDir, targetDir, filename), {overwrite: true}, eachCb);
|
2018-05-08 13:36:50 +00:00
|
|
|
}, cb);
|
|
|
|
return;
|
2018-05-08 13:25:37 +00:00
|
|
|
}
|
2018-05-08 13:36:50 +00:00
|
|
|
|
2018-10-03 14:02:29 +00:00
|
|
|
let content = contentFiles.map(file => {
|
2018-05-08 13:36:50 +00:00
|
|
|
if (file === undefined) {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
return file.content;
|
|
|
|
}).join("\n");
|
|
|
|
|
2018-10-03 14:02:29 +00:00
|
|
|
if (new RegExp(/^index.html?/i).test(targetFile)) {
|
2018-05-22 05:15:34 +00:00
|
|
|
targetFile = targetFile.replace('index', 'index-temp');
|
|
|
|
placeholderPage = targetFile;
|
|
|
|
}
|
2018-08-17 17:41:07 +00:00
|
|
|
fs.writeFile(utils.joinPath(self.buildDir, targetFile), content, cb);
|
2018-05-08 13:36:50 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
},
|
2018-08-16 21:00:06 +00:00
|
|
|
next
|
|
|
|
);
|
2018-05-22 05:15:34 +00:00
|
|
|
},
|
|
|
|
function removePlaceholderPage(next){
|
2018-08-17 17:41:07 +00:00
|
|
|
let placeholderFile = utils.joinPath(self.buildDir, placeholderPage);
|
|
|
|
fs.access(utils.joinPath(self.buildDir, placeholderPage), (err) => {
|
2018-05-22 05:15:34 +00:00
|
|
|
if (err) return next(); // index-temp doesn't exist, do nothing
|
|
|
|
|
|
|
|
// rename index-temp.htm/l to index.htm/l, effectively replacing our placeholder page
|
|
|
|
// with the contents of the built index.html page
|
|
|
|
fs.move(placeholderFile, placeholderFile.replace('index-temp', 'index'), {overwrite: true}, next);
|
|
|
|
});
|
2018-05-08 13:36:50 +00:00
|
|
|
}
|
|
|
|
], callback);
|
2017-12-12 17:20:57 +00:00
|
|
|
}
|
|
|
|
|
2018-05-16 19:07:47 +00:00
|
|
|
buildContracts(cb) {
|
2018-01-10 15:43:25 +00:00
|
|
|
const self = this;
|
|
|
|
async.waterfall([
|
2018-05-16 19:07:47 +00:00
|
|
|
function makeDirectory(next) {
|
2018-10-03 14:02:29 +00:00
|
|
|
fs.mkdirp(fs.dappPath(self.buildDir, 'contracts'), err => next(err));
|
2018-05-10 14:10:09 +00:00
|
|
|
},
|
2018-05-16 19:07:47 +00:00
|
|
|
function getContracts(next) {
|
2018-10-03 14:02:29 +00:00
|
|
|
self.events.request('contracts:list', next);
|
2018-05-07 19:48:01 +00:00
|
|
|
},
|
2018-05-16 19:07:47 +00:00
|
|
|
function writeContractsJSON(contracts, next) {
|
2018-10-03 14:02:29 +00:00
|
|
|
async.each(contracts,(contract, eachCb) => {
|
|
|
|
fs.writeJson(fs.dappPath(
|
|
|
|
self.buildDir,
|
|
|
|
'contracts', contract.className + '.json'
|
|
|
|
), contract, {spaces: 2}, eachCb);
|
|
|
|
}, () => next());
|
2018-05-16 19:07:47 +00:00
|
|
|
}
|
|
|
|
], cb);
|
2016-08-21 16:02:02 +00:00
|
|
|
}
|
2017-06-28 00:27:24 +00:00
|
|
|
|
2018-05-15 22:21:00 +00:00
|
|
|
buildWeb3JS(cb) {
|
|
|
|
const self = this;
|
|
|
|
async.waterfall([
|
2018-05-07 19:48:01 +00:00
|
|
|
function makeDirectory(next) {
|
2018-10-03 14:02:29 +00:00
|
|
|
fs.mkdirp(fs.dappPath(".embark"), err => next(err));
|
2018-01-10 15:43:25 +00:00
|
|
|
},
|
2018-05-16 19:07:47 +00:00
|
|
|
function getWeb3Code(next) {
|
|
|
|
self.events.request('code-generator:web3js', next);
|
|
|
|
},
|
2018-05-15 22:21:00 +00:00
|
|
|
function writeFile(code, next) {
|
2018-05-07 19:48:01 +00:00
|
|
|
fs.writeFile(fs.dappPath(".embark", 'web3_instance.js'), code, next);
|
2018-01-10 15:43:25 +00:00
|
|
|
}
|
2018-05-07 19:48:01 +00:00
|
|
|
], cb);
|
2017-12-12 19:45:20 +00:00
|
|
|
}
|
2018-10-03 14:02:29 +00:00
|
|
|
|
|
|
|
runPlugins(file, fileContent, fileCb) {
|
|
|
|
const self = this;
|
|
|
|
if (self.pipelinePlugins.length <= 0) {
|
|
|
|
return fileCb(null, {content: fileContent, filename: file.filename, path: file.path, basedir: file.basedir, modified: true});
|
|
|
|
}
|
|
|
|
async.eachSeries(self.pipelinePlugins, (plugin, pluginCB) => {
|
|
|
|
if (file.options && file.options.skipPipeline) {
|
|
|
|
return pluginCB();
|
|
|
|
}
|
|
|
|
|
|
|
|
fileContent = plugin.runPipeline({targetFile: file.filename, source: fileContent});
|
|
|
|
file.modified = true;
|
|
|
|
pluginCB();
|
|
|
|
}, err => {
|
|
|
|
if (err) {
|
|
|
|
self.logger.error(err.message);
|
|
|
|
}
|
|
|
|
return fileCb(null, {content: fileContent, filename: file.filename, path: file.path, basedir: file.basedir, modified: true});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2017-03-30 11:12:39 +00:00
|
|
|
}
|
2016-08-21 16:02:02 +00:00
|
|
|
|
2018-05-10 14:10:09 +00:00
|
|
|
module.exports = Pipeline;
|