You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Following the example in
https://support.atlassian.com/bitbucket-cloud/docs/deploy-build-artifacts-to-bitbucket-downloads/
I am attempting to upload into the download area of BitBucket
Followed directions until I get to step 3a
Pasted that into my pipeline
I get the following error
✖ File frontend/build/.zip doesn't exist.
I am assuming that this is because variables do not carry over from 1 step to the next.
My question is how do I get the artifact into the next step?
Where is the docker container going to have its root directory?
Here is my pipeline
image: node:lts
pipelines:
pull-requests:
'**':
- step:
name: Build APP on Pull Requests
caches:
- nodeall
- yarn
script:
- cd frontend
- yarn
- CI=$process_env_ci_pull_request yarn run build
- cd build
- zipfile="AR5-$BITBUCKET_BUILD_NUMBER"
- uname="$BITBUCKET_USERNAME"
- pwd="$BITBUCKET_APP_PASSWORD"
- echo $zipfile
- python -c "import shutil;shutil.make_archive('$zipfile','zip',root_dir='.')"
- dir
#- curl -X POST "https://${BITBUCKET_USERNAME}:${BITBUCKET_APP_PASSWORD}@api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"frontend/build/${zipfile}.zip"
artifacts:
- ${zipfile}.zip
- step:
script:
- pipe: atlassian/bitbucket-upload-file:0.3.3
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
FILENAME: "frontend/build/AR-${$BITBUCKET_BUILD_NUMBER}.zip"
definitions:
caches:
nodeall: ./node_modules
yarn: /usr/local/share/.cache/yarn
Hello @Scott Remiger ,
Thank you for reaching out to Atlassian Community.
The error you are receiving is because currently it's not possible to use environment variables in the artifacts section of the YML file. We already have a feature request to implement the ability to reference environment variables in the artifacts definitions, which you can access using the following link :
I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with this policy in mind.
While this feature is not implemented, you will need either to provide the hard-coded full name of the artifact or use glob patterns . For some examples on how to define the artifacts using glob patterns, you can refer to Use artifacts in steps.
Thank you, @Scott Remiger !
Kind regards,
Patrik S
So I switched it to using a Glob Pattern and the artifact did not show up.
Any help would be appreciated.
image: node:lts
pipelines:
pull-requests:
'**':
- step:
name: Build APP on Pull Requests
caches:
- nodeall
- yarn
script:
- cd frontend
- yarn
- CI=$process_env_ci_pull_request yarn run build
- cd build
- zipfile="AR5-$BITBUCKET_BUILD_NUMBER"
- uname="$BITBUCKET_USERNAME"
- pwd="$BITBUCKET_APP_PASSWORD"
- python -c "import shutil;shutil.make_archive('$zipfile','zip',root_dir='.')"
- dir
artifacts:
- frontend/build/AR5-*.zip
- step:
script:
- pipe: atlassian/bitbucket-upload-file:0.3.3
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
FILENAME: "frontend/build/AR-*.zip"
definitions:
caches:
nodeall: ./node_modules
yarn: /usr/local/share/.cache/yarn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Scott Remiger ,
Could you please confirm if the artifact is being generated in the first steps? To check this you can open the step in Bitbucket UI and search for a message similar to the one below in the Build Teardown section :
Searching for files matching artifact pattern frontend/build/AR5-*.zip
Artifact pattern frontend/build/AR5-*.zip matched 1 files with a total size of 11 B
Compressed files matching artifact pattern frontend/build/AR5-*.zip to 131 B in 0 seconds
Uploading artifact of 131 B
Successfully uploaded artifact in 0 seconds
This means the pipeline was able to identify files matching the pattern in the folder you provided and created an artifact that will be downloaded in the next steps.
Also, checking your second step, it seems to contain a typo in the FILENAME glob definition. It's currently set as :
FILENAME: "frontend/build/AR-*.zip"
But it should be :
FILENAME: "frontend/build/AR5-*.zip"
To match the name you gave to the file in the first step.
Could you double-check this and let us know how it goes?
Thank you, @Scott Remiger .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.