I built a Python app that needs to be deployed to AWS ECS, and this will be the first Python app for my team, since it's been all Node apps until now. I've also never built a Bitbucket/devops pipeline, so I'm somewhat lost as to what needs to be built out. In other words, I might be using the wrong terminology and/or thinking of the wrong things.
So I've been looking at the `bitbucket-pipelines.yml` files of the Node apps and am trying to figure out how to do the same but with Python. If the following is the Node app's YAML file, what's the Python equivalent of the `npm` lines:
definitions:
steps:
- step: &test-step
name: Test
caches:
- node
script:
- mkdir /aws && cd /aws && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip -qq awscliv2.zip && ./aws/install && cd -
- npm run ca:login
- npm install
- npm test
- step: &build-step
name: Build
services:
- docker
script: &build-script
- mkdir /aws && cd /aws && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip -qq awscliv2.zip && ./aws/install && cd -
- npm run ca:login
- cp ~/.npmrc .
- docker build -t node-app-name .
- step: &build-publish-step
name: Build and Publish
services:
- docker
script: *build-script
after-script:
- npm version patch -m "[skip ci] Bumped to version %s by Bitbucket, build ${BITBUCKET_BUILD_NUMBER}"
- git push --follow-tags
- export VERSION=$(node -pe "require('./package.json').version")
- echo export VERSION=$VERSION > environment.sh
I know I should set `caches: -pip`. Should the script be `pip install -r requirements.txt`? Or should I be copying what's in the `package.json``ca:login` variable into a step?