Skip to content

Commit

Permalink
Revert "Update to v1.2.0"
Browse files Browse the repository at this point in the history
This reverts commit b559ff4.
  • Loading branch information
eggoynes committed Oct 20, 2022
1 parent b559ff4 commit 4d680c1
Show file tree
Hide file tree
Showing 32 changed files with 467 additions and 1,303 deletions.
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# compiled output
**/dist
**/global-s3-assets
**/regional-s3-assets
**/open-source
**/.zip
**/tmp

# dependencies
**/coverage
**/node_modules

# misc
**/npm-debug.log
**/package-lock.json
**/.vscode/settings.json
**/.DS_Store
**/.vscode
13 changes: 0 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ 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).

## [1.2.0] - 2022-10-17
### Added
- AppRegistry Application Stack Association
- Application Insights in AppRegistry
- SonarQube properties file: sonar-project.properties
- Added unit tests with 80% code coverage
### Changed
- Changed deployment/run-unit-tests.sh to generate unit test coverage reports
### Contributors
* @sandimciin
* @eggoynes

## [1.1.0] - 2021-7-29
### Added
Expand All @@ -33,8 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added extra steps when building in the Readme file. (https://github.com/awslabs/video-on-demand-on-aws-foundations/issues/4)
- Updated Axios to version 0.21.1

### Contributors
* @eggoynes
## [1.0.0] - 2020-11-05
### Added
- All files, initial version
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ reported the issue. Please try to include as much information as you can. Detail
## Contributing via Pull Requests
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

1. You are working against the latest source on the *main* branch.
1. You are working against the latest source on the *master* branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.

Expand Down Expand Up @@ -57,6 +57,6 @@ If you discover a potential security issue in this project we ask that you notif

## Licensing

See the [LICENSE](https://github.com/awslabs/%%SOLUTION_NAME%%/blob/main/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
See the [LICENSE](https://github.com/awslabs/%%SOLUTION_NAME%%/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ For details on deploying the solution using the CDK see the [CDK Getting Started
### 1. Running unit tests for customization
Run unit tests to make sure added customization passes the tests:
```
cd ./deployment
cd source/custom-resource
npm install
cd ../job-submit
npm install
# Then go back to deployment directory
cd ../../deployment
chmod +x ./run-unit-tests.sh
./run-unit-tests.sh
```
Expand All @@ -45,14 +51,14 @@ aws s3 mb s3://my-bucket-us-east-1
Build the distributable:
```
chmod +x ./build-s3-dist.sh
./build-s3-dist.sh my-bucket video-on-demand-on-aws-foundation v1.2.0
./build-s3-dist.sh my-bucket video-on-demand-on-aws-foundation v1.0.0
```

> **Notes**: The _build-s3-dist_ script expects the bucket name as one of its parameters, and this value should not include the region suffix.
Deploy the distributable to the Amazon S3 bucket in your account:
```
aws s3 cp ./regional-s3-assets/ s3://my-bucket-us-east-1/video-on-demand-on-aws-foundation/v1.2.0/ --recursive --acl bucket-owner-full-control
aws s3 cp ./regional-s3-assets/ s3://my-bucket-us-east-1/video-on-demand-on-aws-foundation/v1.0.0/ --recursive --acl bucket-owner-full-control
```

### 4. Launch the CloudFormation template.
Expand All @@ -61,7 +67,7 @@ aws s3 cp ./regional-s3-assets/ s3://my-bucket-us-east-1/video-on-demand-on-aws-

***

Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -74,3 +80,5 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

This solution collects anonymous operational metrics to help AWS improve the quality of features of the solution. For more information, including how to disable this capability, please see the implementation guide.
12 changes: 7 additions & 5 deletions deployment/build-s3-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Parameters:
# - 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.2.0
# 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
# - solution-name: name of the solution for consistency
# - version-code: version of the package
Expand All @@ -30,7 +30,7 @@ cdk_version=1.63.0
# Check to see if input has been provided:
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
echo "Please provide all required parameters for the build script"
echo "For example: ./build-s3-dist.sh solutions trademarked-solution-name v1.2.0"
echo "For example: ./build-s3-dist.sh solutions trademarked-solution-name v1.0.0"
exit 1
fi

Expand All @@ -57,6 +57,11 @@ mkdir -p $build_dist_dir
rm -rf $staging_dist_dir
mkdir -p $staging_dist_dir

echo "------------------------------------------------------------------------------"
echo "[Init] Update local CDK CLI for building"
echo "------------------------------------------------------------------------------"
npm install -g aws-cdk@latest

echo "------------------------------------------------------------------------------"
echo "[Init] Install dependencies for the cdk-solution-helper"
echo "------------------------------------------------------------------------------"
Expand All @@ -66,9 +71,6 @@ npm install --production
echo "------------------------------------------------------------------------------"
echo "[Synth] CDK Project"
echo "------------------------------------------------------------------------------"
# Make sure user has the newest CDK version
npm uninstall -g aws-cdk && npm install -g aws-cdk@1

cd $source_dir/cdk
npm install
cdk synth --output=$staging_dist_dir
Expand Down
2 changes: 1 addition & 1 deletion deployment/cdk-solution-helper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ After:
```

***
© Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 changes: 1 addition & 1 deletion deployment/cdk-solution-helper/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
* with the License. A copy of the License is located at
Expand Down
82 changes: 12 additions & 70 deletions deployment/run-unit-tests.sh
Original file line number Diff line number Diff line change
@@ -1,73 +1,15 @@
#!/bin/bash
cd ../source/cdk
npm install --silent
npm test

[ "$DEBUG" == 'true' ] && set -x
set -e
cd ../custom-resource
npm install --silent
npm test

prepare_jest_coverage_report() {
local component_name=$1
cd ../job-submit
npm install --silent
npm test

if [ ! -d "coverage" ]; then
echo "ValidationError: Missing required directory coverage after running unit tests"
exit 129
fi

# prepare coverage reports
rm -fr coverage/lcov-report
mkdir -p $coverage_reports_top_path/jest
coverage_report_path=$coverage_reports_top_path/jest/$component_name
rm -fr $coverage_report_path
mv coverage $coverage_report_path
}

run_javascript_test() {
local component_path=$1
local component_name=$2

echo "------------------------------------------------------------------------------"
echo "[Test] Run javascript unit test with coverage for $component_name"
echo "------------------------------------------------------------------------------"
echo "cd $component_path"
cd $component_path

# install dependencies
npm install --silent
# run unit tests
npm test



# prepare coverage reports
prepare_jest_coverage_report $component_name
}

# Get reference for all important folders
template_dir="$PWD"
source_dir="$template_dir/../source"
coverage_reports_top_path=$source_dir/test/coverage-reports

# Test the attached Lambda function
declare -a lambda_packages=(
"cdk"
"custom-resource"
"job-complete"
"job-submit"
)

for lambda_package in "${lambda_packages[@]}"
do
rm -rf $source_dir/$lambda_package/coverage
mkdir $source_dir/$lambda_package/coverage
run_javascript_test $source_dir/$lambda_package $lambda_package

# Check the result of the test and exit if a failure is identified
if [ $? -eq 0 ]
then
echo "Test for $lambda_package passed"
else
echo "******************************************************************************"
echo "Lambda test FAILED for $lambda_package"
echo "******************************************************************************"
exit 1
fi

done
cd ../job-complete
npm install --silent
npm test
2 changes: 1 addition & 1 deletion source/cdk/bin/vod-foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import * as cdk from '@aws-cdk/core';
import { VodFoundation } from '../lib/vod-foundation-stack';

const app = new cdk.App();
new VodFoundation(app, 'VodFoundation'); // NOSONAR
new VodFoundation(app, 'VodFoundation');
Loading

0 comments on commit 4d680c1

Please sign in to comment.