-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16bef0e
commit 82f0d7b
Showing
19 changed files
with
520 additions
and
666 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [4.3.0] - 2019-11-01 | ||
### Added | ||
- CHANGELOG file | ||
|
||
### Changed | ||
- Lambda functions (except for mediainfo) runtime to nodejs10.x | ||
- Mediainfo lambda function to python3.7 | ||
- Mediainfo executable version (from v0.7.92.1 to v19.09) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## Code of Conduct | ||
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). | ||
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact | ||
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). | ||
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact | ||
[email protected] with any additional questions or comments. |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,88 @@ | ||
#!/bin/bash | ||
# | ||
# This assumes all of the OS-level configuration has been completed and git repo has already been cloned | ||
# | ||
# This script should be run from the repo's deployment directory | ||
# cd deployment | ||
# ./build-s3-dist.sh source-bucket-base-name trademarked-solution-name version-code | ||
# | ||
# Paramenters: | ||
# - source-bucket-base-name: Name for the S3 bucket location where the template will source the Lambda | ||
# code from. The template will append '-[region_name]' to this bucket name. | ||
# For example: ./build-s3-dist.sh solutions my-solution v1.0.0 | ||
# The template will then expect the source code to be located in the solutions-[region_name] bucket | ||
# | ||
# - trademarked-solution-name: name of the solution for consistency | ||
# | ||
# - version-code: version of the package | ||
|
||
# Check to see if input has been provided: | ||
if [ -z "$1" ] || [ -z "$2" ]; then | ||
echo "Please provide the base source bucket name and version (subfolder) where the lambda code will eventually reside." | ||
echo "For example: ./build-s3-dist.sh solutions v1.0.0" | ||
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then | ||
echo "Please provide the base source bucket name, trademark approved solution name and version where the lambda code will eventually reside." | ||
echo "For example: ./build-s3-dist.sh solutions trademarked-solution-name v1.0.0" | ||
exit 1 | ||
fi | ||
|
||
[ -e dist ] && rm -r dist | ||
echo "== mkdir -p dist" | ||
mkdir -p dist | ||
ls -lh | ||
#TEMPALTE | ||
echo "==cp video-on-demand-on-aws.yaml dist/video-on-demand-on-aws.template" | ||
cp video-on-demand-on-aws.yaml dist/video-on-demand-on-aws.template | ||
echo "==update CODEBUCKET in template with $1" | ||
set -e | ||
|
||
# Get reference for all important folders | ||
template_dir="$PWD" | ||
template_dist_dir="$template_dir/global-s3-assets" | ||
build_dist_dir="$template_dir/regional-s3-assets" | ||
source_dir="$template_dir/../source" | ||
|
||
echo "------------------------------------------------------------------------------" | ||
echo "Rebuild distribution" | ||
echo "------------------------------------------------------------------------------" | ||
rm -rf $template_dist_dir | ||
mkdir -p $template_dist_dir | ||
rm -rf $build_dist_dir | ||
mkdir -p $build_dist_dir | ||
|
||
echo "------------------------------------------------------------------------------" | ||
echo "CloudFormation Template" | ||
echo "------------------------------------------------------------------------------" | ||
cp $template_dir/video-on-demand-on-aws.yaml $template_dist_dir/video-on-demand-on-aws.template | ||
|
||
replace="s/CODEBUCKET/$1/g" | ||
sed -i -e $replace dist/video-on-demand-on-aws.template | ||
echo "==update CODEVERSION in template with $2" | ||
replace="s/CODEVERSION/$2/g" | ||
sed -i -e $replace dist/video-on-demand-on-aws.template | ||
# remove tmp file for MACs | ||
[ -e dist/video-on-demand-on-aws.template-e ] && rm -r dist/video-on-demand-on-aws.template-e | ||
|
||
#SOURCE CODE | ||
echo "== zip and copy lambda deployment pacages to dist/" | ||
cd ../source/ | ||
|
||
echo "== chmod +x ./mediainfo/bin/mediainfo" | ||
echo "sed -i -e $replace" | ||
sed -i -e $replace $template_dist_dir/video-on-demand-on-aws.template | ||
|
||
replace="s/SOLUTION_NAME/$2/g" | ||
echo "sed -i -e $replace" | ||
sed -i -e $replace $template_dist_dir/video-on-demand-on-aws.template | ||
|
||
replace="s/CODEVERSION/$3/g" | ||
echo "sed -i -e $replace" | ||
sed -i -e $replace $template_dist_dir/video-on-demand-on-aws.template | ||
sed -i -e $replace $template_dir/../README.md | ||
|
||
cp $template_dist_dir/video-on-demand-on-aws.template $build_dist_dir/ | ||
|
||
echo "------------------------------------------------------------------------------" | ||
echo "Lambda Functions" | ||
echo "------------------------------------------------------------------------------" | ||
cd $source_dir | ||
chmod +x ./mediainfo/bin/mediainfo | ||
|
||
for folder in */ ; do | ||
cd "$folder" | ||
echo "==creating deployment package ${PWD##*/}" | ||
rm -rf node_modules/ | ||
npm install --production | ||
rm package-lock.json | ||
zip -q -r9 ../../deployment/dist/${PWD##*/}.zip * | ||
cd ../ | ||
function_name=${PWD##*/} | ||
echo "Creating deployment package for $function_name" | ||
|
||
if [ -e "package.json" ]; then | ||
rm -rf node_modules/ | ||
npm install --production | ||
rm package-lock.json | ||
|
||
zip -q -r9 "$build_dist_dir/$function_name.zip" . | ||
else | ||
python3 setup.py build_pkg --zip-path="$build_dist_dir/$function_name.zip" | ||
fi | ||
|
||
cd .. | ||
done | ||
cd ../deployment/ | ||
echo "== s3 files in dist/:" | ||
ls -lh dist/ | ||
|
||
echo "------------------------------------------------------------------------------" | ||
echo "S3 Packaging Complete" | ||
echo "------------------------------------------------------------------------------" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
cd ../source/archive-source | ||
npm install --silent | ||
npm test | ||
|
||
cd ../custom-resource | ||
npm install --silent | ||
npm test | ||
|
||
cd ../dynamo | ||
npm install --silent | ||
npm test | ||
|
||
cd ../encode | ||
npm install --silent | ||
npm test | ||
|
||
cd ../error-handler | ||
npm install --silent | ||
npm test | ||
|
||
cd ../input-validate | ||
npm install --silent | ||
npm test | ||
|
||
cd ../profiler | ||
npm install --silent | ||
npm test | ||
|
||
cd ../sns-notification | ||
npm install --silent | ||
npm test | ||
|
||
cd ../step-functions | ||
npm install --silent | ||
npm test |
Oops, something went wrong.