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
It looks like you're new here. Sign in or register to get started.