我如何在 Bluemix DevOps 管道阶段使用自定义工具

How do I use custom tools in a Bluemix DevOps pipeline stage

我想在我的 BlueMix DevOps Services 管道的某个阶段使用自定义构建工具(例如,使用 brew install 或类似工具安装)。文档说每个阶段都在一个新容器中运行。如何将我的工具加载到该容器中以便在我的管道阶段使用?

当你在一个阶段创建一个新的作业时,你可以编写一个脚本来执行。在这个脚本中,可以调用apt-get installapt-get update等。

例如:

#!/bin/bash
# your script here
sudo apt-get update
sudo apt-get install jq
jq --help

我使用脚本方法安装工具,如 nvm (https://github.com/creationix/nvm) 以使用任何 Node.js 版本。您将需要重新安装要在需要它们的任何工作中使用的工具。