大厅 CI:static_buildpack 问题

Concourse CI: static_buildpack issue

我正在使用 static_buildpack 将一个简单的 angular4 应用程序部署到 Cloud Foundry。在访问应用程序时,我总是遇到 nginx 403 问题。

jobs:
- name: app
  serial: true
  plan:
  - get: develop-repo
  - task: npm-build
    config:
        platform: linux
        image_resource:
            type: docker-image
            source:
                repository: node
        run:
            path: sh
            args:
            - -exec
            - |
                cd develop-repo
                npm install
                npm run dist                              
        inputs:
        - name: develop-repo
        outputs:
        - name:
  - put: develop
    params:
      manifest: develop-repo/manifest.yml
      current_app_name: app   
      path: develop-repo        



resources:
- name: develop-repo
  type: git
- name: develop
  type: cf

manifest.yml:

---
applications:
- name: app
  instances: 1
  memory: 512M
  disk_quota: 512M  
  buildpack: staticfile_buildpack 
  stack: cflinuxfs2 

我所做的只是git clone -> npm build -> cf deploy

注意:所有资源变量都设置正确。只是为了更好的可读性而被忽略

尝试了几个选项后,我发现通过将工件发布到输出文件夹,我们可以从输出文件夹推送应用程序

---
jobs:
- name: app
  serial: true
  plan:
  - get: develop
  - task: npm-build
    config:
        platform: linux
        image_resource:
            type: docker-image
            source:
                repository: node
        inputs:
        - name: develop
        outputs:
        - name: artifacts
        run:
            path: sh
            args:
            - -exec
            - |
                cd develop
                npm install
                npm run dist
                ls
                cp -R dist ../artifacts/                            

  - put: deploy-cf
    params:
        manifest: develop/ci/manifests/manifest-int.yml
        path: artifacts/dist


resources:
- name: develop
  type: git
  source:
    uri: <<GITHUB-URI>>
    branch:<<GITHUB-BRANCH>>
    username:<<GITHUB-USERNAME>>
    password: <<GITHUB-PASSWORD>>
- name: deploy-cf
  type: cf
  source:
    api: <<CF-API>>
    username: <<CF-USERNAME>>
    password: <<CF-PASSWORD>>
    organization: <<CF-ORG>>
    space: <<CF-SPACE>>