Hello! I have a pipeline with a centos7 image. I have some artifact files in the first step and I would like to use them in the second step, but I can't do that.
Where can I find or how can I use the artifact files in the second step?
Here is my code:
pipelines:
branches:
master:
- step:
name: devbuild
image: centos:7
script:
- yum -y install git
- curl -LO https://storage.googleapis.com/golang/go1.10.3.linux-amd64.tar.gz
- tar -C /usr/local -xvzf go1.10.3.linux-amd64.tar.gz
- mkdir -p ~/projects/{bin,pkg,src}
- mkdir -p ~/projects/src/${BITBUCKET_REPO_SLUG}
- tar -cO --exclude-vcs --exclude=bitbucket-pipelines.yml . | tar -xv -C ~/projects/src/${BITBUCKET_REPO_SLUG}
- cd ~/projects/src/${BITBUCKET_REPO_SLUG}
- export PATH=$PATH:/usr/local/go/bin
- export GOBIN="$HOME/projects/bin"
- export GOPATH="$HOME/projects"
- go get
- go build -o "${BITBUCKET_REPO_SLUG}.cms"
- cp "${BITBUCKET_REPO_SLUG}.cms" $BITBUCKET_CLONE_DIR
artifacts:
- /${BITBUCKET_REPO_SLUG}.cms
- /assets/**/*
- /modules/**/*
- /templates/**/*
- step:
name: deploy
image: python:3.5.1
script:
- find / -name "${BITBUCKET_REPO_SLUG}.cms"
# I can't find the built .cms file on the server
# how, where can I find it and how can i use it?
Thank you for the answers,
Peter
Hi Peter,
Can you try the following YAML. I've annotated the changes I've made to your artifacts:
pipelines:
branches:
master:
- step:
name: devbuild
image: centos:7
script:
- yum -y install git
- curl -LO https://storage.googleapis.com/golang/go1.10.3.linux-amd64.tar.gz
- tar -C /usr/local -xvzf go1.10.3.linux-amd64.tar.gz
- mkdir -p ~/projects/{bin,pkg,src}
- mkdir -p ~/projects/src/${BITBUCKET_REPO_SLUG}
- tar -cO --exclude-vcs --exclude=bitbucket-pipelines.yml . | tar -xv -C ~/projects/src/${BITBUCKET_REPO_SLUG}
- cd ~/projects/src/${BITBUCKET_REPO_SLUG}
- export PATH=$PATH:/usr/local/go/bin
- export GOBIN="$HOME/projects/bin"
- export GOPATH="$HOME/projects"
- go get
- go build -o "${BITBUCKET_REPO_SLUG}.cms"
- cp "${BITBUCKET_REPO_SLUG}.cms" $BITBUCKET_CLONE_DIR
artifacts:
- *.cms # Environment variables aren't supported in artifact section
- assets/**/* # Remove leading '/'
- modules/**/* # Remove leading '/'
- templates/**/* # Remove leading '/'
- step:
name: deploy
image: python:3.5.1
script:
- find / -name "${BITBUCKET_REPO_SLUG}.cms"
# I can't find the built .cms file on the server
# how, where can I find it and how can i use it?
I think the issue was that you were trying to upload off the root directory of the container, not your build directory. And I can't recall exactly, but I don't think we support environment variables in the artifacts sections. But, feel free to give it another go if everything else works now.
If that doesn't work it's probably going to be something a bit more fiddly. If that's the case, can you share:
1. The output of the 'Build teardown' of the 'devbuild' step.
2. The output of the 'Build setup' of the 'deploy' step.
Thanks,
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.