So I'm trying to deploy a Wordpress plugin to a WPEngine-hosted website using Bitbucket Pipelines.
I'm using WPEngine's pipe: https://bitbucket.org/wpengine/wpe-site-deploy/src/main/pipe.yml
I need to run "composer install" to install PHP dependencies before the pipe runs.
Here's my bitbucket-pipelines.yml:
pipelines:
branches:
master:
- step:
name: Deploy to Development
script:
- apt update && apt -y upgrade
- apt -y install language-pack-en-base
- export LC_ALL=en_US.UTF-8
- export LANG=en_US.UTF-8
- apt -y install software-properties-common
- add-apt-repository --yes ppa:ondrej/php
- apt update
- apt -y install php8.1
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- pipe: wpengine/wpe-site-deploy:v1
variables:
WPE_SSHG_KEY_PRIVATE: $WPE_SSHG_KEY_PRIVATE
WPE_ENV: 'xxx'
REMOTE_PATH: 'wp-content/plugins/xxx/'
Everything is running swimmingly until the part where it tries to install php8.1:
Reading state information...
E: Unable to locate package php8.1
But the repository was added without issues:
Answering my own question.
Turns out WPEngine by default already has Composer installed.
So I don't actually have to install and setup composer BEFORE their Pipe runs.
I can have a bash script in my source code which runs "composer install", and have this script run AFTER the pipe completes, like so:
pipelines:
branches:
master:
- step:
name: Deploy to Development
script:
- pipe: wpengine/wpe-site-deploy:v1
variables:
WPE_SSHG_KEY_PRIVATE: $WPE_SSHG_KEY_PRIVATE
WPE_ENV: 'xxxx'
REMOTE_PATH: 'wp-content/plugins/xxxx/'
SCRIPT: 'bitbucket-pipelines-post-deploy.sh'
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.