Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,457,938
Community Members
 
Community Events
176
Community Groups

Bitbucket pipeline artifacts could not be found

btosic I'm New Here Dec 26, 2022

Here is the complete pipeline that should publish the .net package as zip and store as an artifact. Next step should use that artifact to deploy on azure. Tab artifact is always empty. Is there anything I made wrong or it can be related to the bitbucket server?


image: mcr.microsoft.com/dotnet/sdk:6.0

pipelines:
branches:
master:
- step:
name: Build and publish .NET app
caches:
- dotnetcore
script:
- curl -sL https://deb.nodesource.com/setup_14.x | bash -
- apt-get install -y nodejs
- cd DutchKnittingCompany
- dotnet publish -o publish -c Release
- cd publish
- apt-get -y install zip
- zip -r api-$BITBUCKET_BUILD_NUMBER.zip .
artifacts:
- "*.zip"
- step:
name: Deploy .NET to Azure AppService
deployment: Azure
script:
- pipe: atlassian/azure-web-apps-deploy:1.0.1
variables:
AZURE_APP_ID: $AZURE_APP_ID
AZURE_PASSWORD: $AZURE_PASSWORD
AZURE_TENANT_ID: $AZURE_TENANT_ID
AZURE_RESOURCE_GROUP: $RESOURCE_GROUP
AZURE_APP_NAME: $APP_NAME
ZIP_FILE: 'api-$BITBUCKET_BUILD_NUMBER.zip'

 

Error I'm getting:


INFO: Starting deployment to Azure app service...
az webapp deployment source config-zip --resource-group DKCResGroup --name dkcapi --src api-40.zip
ERROR: [Errno 2] No such file or directory: '/opt/atlassian/pipelines/agent/build/api-40.zip'
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in execute
raise ex
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 386, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 379, in _run_job
six.reraise(*sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 356, in _run_job
result = cmd_copy(params)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 171, in __call__
return self.handler(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 441, in default_command_handler
return op(**command_args)
File "/usr/local/lib/python3.6/site-packages/azure/cli/command_modules/appservice/custom.py", line 267, in enable_zip_deploy
with open(os.path.realpath(os.path.expanduser(src)), 'rb') as fs:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/atlassian/pipelines/agent/build/api-40.zip'
✖ Deployment failed.

1 answer

0 votes

Hello @btosic ,

Welcome to Atlassian Community!

Just sharing a bit of context, at the end of the build bitbucket will look for artifacts that are within BITBUCKET_CLONE_DIR. The BITBUCKET_CLONE_DIR is the directory in which the repository was initially cloned. More on that in Use artifacts in steps.

Looking at your YML file, it seems like you are generating the artifact inside a folder called DutchKnittingCompany/publish, while your current YML configuration is looking for *.zip files only in the root folder (BITBUCKET_CLONE_DIR).

To generate an artifact for every .zip file inside a folder called DutchKnittingCompany/publish, you should configure  the artifact section of your step as the following example : 

script:
- curl -sL https://deb.nodesource.com/setup_14.x | bash -
- apt-get install -y nodejs
- cd DutchKnittingCompany
- dotnet publish -o publish -c Release
- cd publish
- apt-get -y install zip
- zip -r api-$BITBUCKET_BUILD_NUMBER.zip .
artifacts:
- DutchKnittingCompany/publish/*.zip

Could you try using the suggestion above and let us know how it goes? 

Thank you, @btosic .

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events