运行 大厅管道中的 npm
Running npm in concourse pipeline
我如何将需要获取 git 存储库、运行 npm install 和 npm build 然后推送到 cloud foundry 的管道添加为我的管道的一部分?
到目前为止,我能够做到这一点,以便它获取存储库并推送到 Cloud Foundry。但不完全确定如何构建 npm 任务。我正在使用 BOSH 主管来处理所有大厅事务。
任何方向或想法将不胜感激。我在这里关注本教程,并以此为基础建立我的管道:
(我将在哪里以及如何添加构建 npm 任务?)
---
resources:
- name: resource-web-app
type: git
source:
uri: https://github.com/cloudfoundry-community/simple-go-web-app.git
- name: resource-deploy-web-app
type: cf
source:
api: {{cf-api}}
username: {{cf-username}}
password: {{cf-password}}
organization: {{cf-organization}}
space: {{cf-space}}
skip_cert_check: true
jobs:
- name: job-deploy-app
serial: true
plan:
- {get: resource-web-app, trigger: true}
- put: resource-deploy-web-app
params:
manifest: resource-web-app/manifest.yml
path: resource-web-app
https://github.com/starkandwayne/concourse-tutorial/tree/master/15_deploy_cloudfoundry_app
在推送到 Cloud Foundry 之前,您需要编写一个 task 来运行运行 npm install
和 npm build
的脚本。
同样重要的是要注意,在下面的脚本中,concourse 将在目录 resource-deploy-web-app
中查找要推送到 cf 的位,因此请确保将要推送的所有内容都放在脚本中。
因此您的新工作配置将类似于:
jobs:
- name: job-deploy-app
serial: true
plan:
- {get: resource-web-app, trigger: true}
- task: build-npm
config:
platform: linux
image_resource:
type: docker-image
source:
repository: node
inputs:
- name: resource-web-app
run:
path: resource-web-app/scripts/script-that-does-npm-stuff.sh
outputs:
- name: resource-deploy-web-app
- put: resource-deploy-web-app
params:
manifest: resource-web-app/manifest.yml
path: resource-web-app
我如何将需要获取 git 存储库、运行 npm install 和 npm build 然后推送到 cloud foundry 的管道添加为我的管道的一部分?
到目前为止,我能够做到这一点,以便它获取存储库并推送到 Cloud Foundry。但不完全确定如何构建 npm 任务。我正在使用 BOSH 主管来处理所有大厅事务。
任何方向或想法将不胜感激。我在这里关注本教程,并以此为基础建立我的管道: (我将在哪里以及如何添加构建 npm 任务?)
---
resources:
- name: resource-web-app
type: git
source:
uri: https://github.com/cloudfoundry-community/simple-go-web-app.git
- name: resource-deploy-web-app
type: cf
source:
api: {{cf-api}}
username: {{cf-username}}
password: {{cf-password}}
organization: {{cf-organization}}
space: {{cf-space}}
skip_cert_check: true
jobs:
- name: job-deploy-app
serial: true
plan:
- {get: resource-web-app, trigger: true}
- put: resource-deploy-web-app
params:
manifest: resource-web-app/manifest.yml
path: resource-web-app
https://github.com/starkandwayne/concourse-tutorial/tree/master/15_deploy_cloudfoundry_app
在推送到 Cloud Foundry 之前,您需要编写一个 task 来运行运行 npm install
和 npm build
的脚本。
同样重要的是要注意,在下面的脚本中,concourse 将在目录 resource-deploy-web-app
中查找要推送到 cf 的位,因此请确保将要推送的所有内容都放在脚本中。
因此您的新工作配置将类似于:
jobs:
- name: job-deploy-app
serial: true
plan:
- {get: resource-web-app, trigger: true}
- task: build-npm
config:
platform: linux
image_resource:
type: docker-image
source:
repository: node
inputs:
- name: resource-web-app
run:
path: resource-web-app/scripts/script-that-does-npm-stuff.sh
outputs:
- name: resource-deploy-web-app
- put: resource-deploy-web-app
params:
manifest: resource-web-app/manifest.yml
path: resource-web-app