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 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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will investigate this, add this as feature request to the pipe, and notify you when this feature will become available.
Regards, Igor
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.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I came across the blog post from 2019
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.