What it wouldn’t let me add on the title, is upon successful builds? Any help would be appreciated.
To set up Travis CI for your multi-language monorepo, start by connecting your GitHub repository to Travis CI. Then, create a .travis.yml
file in the root directory of your project. In this file, specify the languages you’re using, such as Python and Node.js. Set up jobs for each language to run tests and deploy to AWS Lambda and Heroku. Install any necessary dependencies for all jobs, and set environment variables for AWS and Heroku credentials.
Encrypt sensitive data using the Travis CLI. Once you’ve completed these steps, commit and push your changes to GitHub. Travis CI will automatically detect the push, run the tests in parallel, and deploy the applications to AWS Lambda and Heroku if the builds are successful. Here’s an example of a .travis.yml
that fits your use case pretty well:
matrix:
include:
- language: python
python:
- "3.8"
before_install:
- cd python-app
install:
- pip install -r requirements.txt
script:
- pytest
deploy:
provider: lambda
function_name: my-python-lambda
region: us-west-2
role: arn:aws:iam::123456789012:role/lambda-role
runtime: python3.8
handler_name: handler
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
- language: node_js
node_js:
- "14"
before_install:
- cd node-app
install:
- npm install
script:
- npm test
deploy:
provider: heroku
api_key: $HEROKU_API_KEY
app: my-node-app
env:
global:
- secure: "encrypted-aws-access-key-id"
- secure: "encrypted-aws-secret-access-key"
- secure: "encrypted-heroku-api-key"
I hope this was of help. If you need anymore type of help or questions please let me know and I’ll be glad to help you.
Cheers,
Montana