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
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
To update, I have also tried using this:
artifacts:
- dist/**
script:
- cd wp-content/themes/$THEME_NAME
- npm ci
- npm run build
- ls -l dist
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.