Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipeline artifacts not deployed

Jacob Leech
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 11, 2022

Hi there, I have a bitbucket-pipeline.yml file setup as below:

definitions:
caches:
node: wp-content/themes/$THEME_NAME/node_modules
steps:
- step: &npm
name: Build frontend
image: node:16
caches:
- node
script:
- cd wp-content/themes/$THEME_NAME
- npm ci
- npm run build
artifacts:
- wp-content/themes/$THEME_NAME/dist/**
- step: &deploy
name: Deploy to staging
deployment: staging
script:
- pipe: atlassian/rsync-deploy:0.7.1
variables:
USER: $FTP_USER
SERVER: $FTP_STAGE_ADDRESS
REMOTE_PATH: $FTP_STAGE_PATH
LOCAL_PATH: $BITBUCKET_CLONE_DIR
EXTRA_ARGS: "-rvz --exclude=.vscode --exclude=.htaccess --exclude=.gitignore --exclude=wp-config.php --exclude=wp-includes/ --exclude=wp-admin/ --exclude=wp-content/uploads/ --exclude=wp-content/languages/ --exclude=node_modules/ --exclude=wp-content/themes/*/node_modules/ --exclude=.git/ --exclude=wp-content/themes/*/src/ --exclude=wp-activate.php --exclude=wp-blog-header.php --exclude=wp-comments-post.php --exclude=wp-config-sample.php --exclude=wp-cron.php --exclude=wp-links-opml.php --exclude=wp-load.php --exclude=wp-login.php --exclude=wp-mail.php --exclude=wp-settings.php --exclude=wp-signup.php --exclude=wp-trackback.php --exclude=xmlrpc.php --exclude=*.scss --chown=www-data:www-data"

pipelines:
branches:
develop:
- step: *npm
- step: *deploy
The pipeline runs successfully, but the compiled artifacts defined in the npm step aren't deployed with the rest of the required files. 
Just wondering why this might be happening? The artifacts file path is relative to the $BITBUCKET_CLONE_DIR.
Cheers.
JL
UPDATE:

To update, I have also tried using this:

artifacts:
- dist/**
still no artifacts are generated... but if I run 
script:
- cd wp-content/themes/$THEME_NAME
- npm ci
- npm run build
- ls -l dist
it prints out the contents of the dist directory.. confusing

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 13, 2022

Hi Jacob and welcome to the community.

I think the issue is that the file path in the artifacts block cannot render variable names.

We have a bug report about this in our issue tracker:

Until this is this fixed, you can either replace $THEME_NAME in the artifacts path with the actual value of the variable or use a path like the following:

artifacts:
- wp-content/themes/**/dist/**

The latter one will work well if there is only one directory in wp-content/themes (the $THEME_NAME directory) with a subdirectory named dist. If there are more directories in wp-content/themes with a subdirectory dist, then they would all be uploaded as artifacts, so you may want to use the value of the variable instead.

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events