Hey community,
Previously I was installing my required Python packages to a zip folder and committing these files to my bitbucket directory where a bitbucket pipeline would deploy these resources to S3. I realized that I could add a step in my pipeline to perform the pip3 install command to install the required packages on each deployment.
What is the best way to configure such as step, because I also need to zip the contents into a folder which gets uploaded to S3. I got the following to work:
- step:
name: Building artifact
script:
- apt update && apt install sudo
- adduser build
- usermod -aG sudo build
- su build
- sudo add-apt-repository ppa:deadsnakes/ppa
- sudo apt install -y python3.9
- sudo apt install -y python3-pip
- python3.9 --version
- mkdir build
- cd lambda
- pip3 install -r requirements.txt
With the default docker image (atlassian/default-image:3), it uses Python 3.8, but I need 3.9 in my use case, and I wasn't able to get that installed unless I added a user.
Is there a better way to get the latest version of python installed with the default atlassian docker image?