Technical · Cloud
AWS Amplify, different build settings for different branches.
August 21, 2022
Using AWS Amplify there are cases when you want to use different build settings per branch, however, as all the branches share the same build file, it could be somehow confusing.
Case
To go around that unique build file for all branches, we are using variables, and if instructions, we ended up having a config like this for one of our projects.
Solution
frontend:
phases:
build:
commands:
- if [ "${AWS_BRANCH}" = "production" ]; then ng build --configuration=production --prod --build-optimizer; fi
- if [ "${AWS_BRANCH}" = "stage" ]; then ng build --configuration=stage --prod --build-optimizer; fi
this way, we can have multiple environments with different build instructions and different URLs, from multiple branches, using only one Amplify build configuration file.
Now, that works great on a single account environment or during Proof of Concepts, once it is an actual project, we would need different accounts for each environment, but that’s for another day.
Do you have an idea and want to make a prototype to see if it is functional or sustainable over time? Then, 23blocks is the best solution that you will find to carry out this development with less effort and investment.
Each of our blocks is a combination of Software, Infrastructure, and Services, which are available as API Microservices. According to industry standards, these are hosted in a highly available cloud, ready for production and use.
Deciding to start a software project can be complicated and intimidating. So, contact us at info@23blocks.com to receive free assistance from our software experts and get started on your idea.
There is a better way to build apps and platforms — the #23blocksway.
Originally published on Medium in 23blocks.
Related reading
- AWS Amplify running Angular 17
January 31, 2024 · Cloud
- Year 1. About Infrastructure
February 17, 2023 · Cloud
- AWS ALB Health Check for multiples app or services on NGINX
February 9, 2022 · Cloud
More in the Digest — a weekly roundup of AI and agents news — or start with AI Strategy.