Continuous integration 从广场CI中的多个SCM然后mv文件拉至workdir
我已经在这个问题上绞尽脑汁很长一段时间了,我想不出来(我知道这一定是一件简单的事情) 目前,我正在尝试从两个存储库中提取文件(这自然会创建两个单独的目录),然后尝试将文件从一个目录移动到另一个目录,以成功执行Dockerfile 下面是我的pipeline.yml文件的外观:Continuous integration 从广场CI中的多个SCM然后mv文件拉至workdir,continuous-integration,yaml,pipeline,mv,concourse,Continuous Integration,Yaml,Pipeline,Mv,Concourse,我已经在这个问题上绞尽脑汁很长一段时间了,我想不出来(我知道这一定是一件简单的事情) 目前,我正在尝试从两个存储库中提取文件(这自然会创建两个单独的目录),然后尝试将文件从一个目录移动到另一个目录,以成功执行Dockerfile 下面是我的pipeline.yml文件的外观: --- jobs: - name: build-nexus-docker-image public: false plan: - get: git-nexus-docker-images trigger
---
jobs:
- name: build-nexus-docker-image
public: false
plan:
- get: git-nexus-docker-images
trigger: true
- get: git-nexus-license
trigger: true
- task: mv-nexus-license
config:
platform: linux
image_resource:
type: docker-image
source: {repository: ubuntu, tag: "trusty"}
inputs:
- name: git-nexus-license
- name: git-nexus-docker-images
run:
path: /bin/sh
args:
- -c
- mv -v git-nexus-license/nexus.lic git-nexus-docker-images/nexus.lic; ls -la git-nexus-docker-images
- put: nexus-docker-image
params:
build: git-nexus-docker-images/
resources:
- name: git-nexus-docker-images
type: git
source:
uri: git@git.company.com:dev/nexus-pro-dockerfile.git
branch: test
paths: [Dockerfile]
private_key: {{git_ci_key}}
- name: git-nexus-license
type: git
source:
uri: git@git.company.com:secrets/nexus-information.git
branch: master
paths: [nexus.lic]
private_key: {{git_ci_key}}
- name: nexus-docker-image
type: docker-image
source:
username: {{aws-token-username}}
password: {{aws-token-password}}
repository: {{ecr-nexus-repo}}
我已经发布了实际上可以部署到Concourse的管道;然而,我尝试了很多东西,但我不知道如何做到这一点。我在将许可证文件从git-nexus-license
目录移动到git-nexus-docker-images
目录时遇到了麻烦。我所做的似乎并不影响nexus.lic
文件,因为在构建docker映像时失败,因为它无法在目录中找到该文件
编辑:我已经成功地使用上面的代码“mv”
nexus.lic
,但是由于找不到文件,构建仍然失败!我不确定我做错了什么,如果我手动操作,构建可以正常工作,但是使用Concourse它失败了。好的,所以我知道我做错了什么,像往常一样,它很小。我忘了将输出添加到yml文件中,该文件告诉concourse这是新的workdir。下面是它现在的样子(对我来说很有用):
我希望这能帮助那些陷入困境的人。:) 好吧,所以我发现我做错了什么,像往常一样,这是一件小事。我忘了将输出添加到yml文件中,该文件告诉concourse这是新的workdir。下面是它现在的样子(对我来说很有用):
我希望这能帮助那些陷入困境的人。:)
---
jobs:
- name: build-nexus-docker-image
public: false
plan:
- get: git-nexus-docker-images
trigger: true
- get: git-nexus-license
trigger: true
- task: mv-nexus-license
config:
platform: linux
image_resource:
type: docker-image
source: {repository: ubuntu, tag: "trusty"}
inputs:
- name: git-nexus-license
- name: git-nexus-docker-images
outputs:
- name: build-nexus-dir
run:
path: /bin/sh
args:
- -c
- mv -v git-nexus-license/nexus.lic build-nexus-dir/nexus.lic; mv -v git-nexus-docker-images/* build-nexus-dir; ls -la build-nexus-dir;
- put: nexus-docker-image
params:
build: build-nexus-dir/
resources:
- name: git-nexus-docker-images
type: git
source:
uri: git@git.company.com:dev/nexus-pro-dockerfile.git
branch: test
paths: [Dockerfile]
private_key: {{git_ci_key}}
- name: git-nexus-license
type: git
source:
uri: git@git.company.com:secrets/nexus-information.git
branch: master
paths: [nexus.lic]
private_key: {{git_ci_key}}
- name: nexus-docker-image
type: docker-image
source:
username: {{aws-token-username}}
password: {{aws-token-password}}
repository: {{ecr-nexus-repo}}