Version 2 of Serverless Media Portal comes with several improvements and breaking changes.
The move to v2 is easy. None of the data (videos, users, tags etc.) that you have already uplaoded will be lost.
- serverless.yml
- All environment variables are now stored in an
env.yml
file.- Previously, you had to manually specify the video and image bucket names. This has been completely removed.
- Similarly, the
serverless.yml
used to contain the FFmpeg ARN. This has been moved to theenv.yml
file. - The
stage
andregion
settings have also been moved to theenv.yml
.
- The benefit of this is that future changes to the
serverless.yml
will not introduce breaking changes.
- All environment variables are now stored in an
The following steps should take 5 minutes or less to complete.
- Go to your existing
serverless-media-portal/backend
directory and open theserverless.yml
file. - In the
custom
section, under line #11, copy the following variables:region
stage
ffmpegLayerArn
numberOfDaysToKeepLogsFor
- Paste these into Notepad (or anywhere) to store them temporarily
- Go to your existing
serverless-media-portal/frontend
directory and open the.env
file. - As before, save the following variables somewhere for safe-keeping:
REACT_APP_imageCloudfrontDomain
REACT_APP_videoCloudfrontDomain
REACT_APP_apiGatewayUrl
- Pull the latest version of the
master
branch of the Serverless Media Portal project from GitHub.- You may have to discard changes you have in the
backend/serverless.yml
andfrontend/.env
. This is OK since you've backed up the environment variables. - If you get merge conflicts, always accept the new, incoming changes. We want to completely replace the contents.
- You may have to discard changes you have in the
- Open
serverless-media-portal/backend
- You should see a new
env.yml
file at the root of the backend project- Replace the variables you saved in Step #1 with the new entries in
env.yml
; none of the names have changed
- Replace the variables you saved in Step #1 with the new entries in
- You should see a new
- Open
serverless-media-portal/frontend
- Again, you'll see a
.env
file with a different format - Add the variables you saved from Step #2 into the new
.env
file; again, none of the names have changed- No functionality is being changed here; it's just tidying up the file to make things easier for people setting up for the first time
- Again, you'll see a
- Install the new dependencies
- Run
npm install
in both backend and frontend
- Run
That's it! Just re-deploy the project and you're done.
- Run through the deploy process:
npm run deploy
in the backend directorynpm run build
in the frontend directory- Deploy to wherever you are hosting (Netlify, S3 etc.)