The Amplify team is hiring 🥳!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 1 | |
frontend: | |
phases: | |
build: | |
commands: [] | |
artifacts: | |
baseDirectory: / | |
files: | |
- '**/*' | |
cache: |
To get started, fork the following project.
git clone [email protected]:swaminator/monorepo-amplify.git
This project contains the frontend code for an angular and react Todo app. The repository has the following structure:
> monorepo-amplify
It was recently announced that AWS Amplify now has built in support for monorepos. Customers who had previously used manual commands in their applications build settings are now able to trigger builds in various apps can now consolidate all of their app settings in a single file at the root of the repository.
Let's assume you have two Amplify apps - app1 and app2 that belong to your monorepo.
- If you have an
amplify.yml
file in your repo, rename it toamplify-old.yml
to back it up. - Go to the app1 in the Amplify console, App settings > build settings and update your buildspec to the new version. For example, a simple app with the following build spec:
version: 1
frontend:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the Amplify Console, navigate to Rewrites and redirects. Add the following depending on what you want: | |
Case 1: | |
Actual content location: /about/index.html | |
What user types in browser: /about/index.html | |
What user sees in browser: /about/ | |
Configure in Amplify Console: /about/index.html /about/ 301 | |
Case 2: | |
Actual content location: /about.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
IFS='|' | |
help_output () { | |
echo "usage: amplify-push <--environment|-e <name>> <--simple|-s>" | |
echo " --environment The name of the Amplify environment to use" | |
echo " --simple Optional simple flag auto-includes stack info from env cache" | |
exit 1 | |
} |