Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

"Unable to locate package php8.1" error when trying to install PHP in pipeline script

Support
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!
June 12, 2023

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:
error.png
Above you can see successful adding of ppa:ondrej/php and apt update completed. But somehow it still can't find PHP 8.1
Can anyone help me out with this ?

1 answer

0 votes
Support
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!
June 12, 2023

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'

Suggest an answer

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

Atlassian Community Events