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

Deploying the contents of a directory with Bitbucket Pipelines Pipe: Azure Storage Deploy

Victor Ferreira April 9, 2024

Hello, everyone,

it is not possible to sync the contents of a directory (and not the directory itself) with the Storage Account in Azure with Bitbucket Pipelines Pipe: Azure Storage Deploy. 

https://bitbucket.org/atlassian/azure-storage-deploy/src/master/

It fails with error: FileNotFoundError: [Errno 2] No such file or directory: 'bar/*'

I found this repository supposedly by Microsoft that says the star sign should work to deploy the contents of the directory:
https://bitbucket.org/microsoft/azure-storage-deploy/src/master/

Is there a way to make it work with the official Atlassian's Pipe? The Microsoft workspace is official too? could someone confirm?

Thank you

3 answers

1 vote
sschroders May 1, 2024

I am trying to deploy to azure using atlassian/azure-storage-deploy:2.2.1 pipe but i am having a hard time getting the content of directory copied to azure. I keep getting the whole directory copied. here is my ymal

image: node:20.11.1 

definitions:
caches:
yarn: node_modules

pipelines:
branches:
master:
- step:
name: 'Build'
caches:
- yarn
script:
- echo "Your build and test goes here..."
- yarn install
- yarn build
artifacts:
- dist/**


- step:
name: Deploy to development
deployment: Development
script:
- echo "Deploying to test environment"
- pipe: atlassian/azure-storage-deploy:2.2.1
variables:
SOURCE: 'dist/'
DESTINATION_STORAGE_ACCOUNT_NAME: $DESTINATION_STORAGE_ACCOUNT_NAME
DESTINATION_SAS_TOKEN: $DESTINATION_SAS_TOKEN
DESTINATION_CONTAINER_NAME: $DESTINATION_CONTAINER_NAME
OVERWRITE: 'true' # Optional.
DEBUG: 'true' # Optional.

 

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 1, 2024

With this version of the pipe you may upload only file or a directory, not the content of a directory.

Update: you could try to cd to needed directory and then provide a dot as source:

- cd dist  
- pipe: atlassian/azure-storage-deploy:2.2.1 variables: SOURCE: '.'

Please, provide a feedback if this helped you.

Regards, Igor

sschroders May 1, 2024

unfortunetly this then gets the whole content of my repo to the azure storage than only the content of dist. on my azure storage I have a static website for my react front end. I need in there the content of the dist do you have any other suggestion how to achieve this?

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 1, 2024


I will investigate this, add this as feature request to the pipe, and notify you when this feature will become available. 

 

Regards, Igor

sschroders May 1, 2024

thanks

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 16, 2024

@sschroders hi. New version azure-storage-deploy:2.4.0 released, that allows you to copy the content of a directory:

script:
  - pipe: atlassian/azure-storage-deploy:2.4.0
    variables:
      SOURCE: 'my-directory/*'
      DESTINATION_STORAGE_ACCOUNT_NAME: 'https://mystorageaccount.blob.core.windows.net'
      DESTINATION_SAS_TOKEN: $AZURE_STORAGE_SAS_TOKEN
      DESTINATION_CONTAINER_NAME: 'my-container'


Regards, Igor

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2024

@Victor Ferreira Hi. Microsoft pipe: https://bitbucket.org/microsoft/azure-storage-deploy/src/master/ is not supported anymore.
To deploy a directory with https://bitbucket.org/atlassian/azure-storage-deploy/src/master/ try to provide a directory name without wildcard:

script:
  - pipe: atlassian/azure-storage-deploy:2.2.1
    variables:
      SOURCE: 'bar'
      DESTINATION_STORAGE_ACCOUNT_NAME: 'https://mystorageaccount.blob.core.windows.net'
      DESTINATION_SAS_TOKEN: $AZURE_STORAGE_SAS_TOKEN
      DESTINATION_CONTAINER_NAME: 'my-container'

Regards, Igor

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2024

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events