Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
166a820
Add github actions
gsingh04 Dec 9, 2022
4e42ee1
Move workflow files
gsingh04 Dec 9, 2022
6ae6e49
Remove redundant workflow file
gsingh04 Dec 9, 2022
d5fa2f8
Run pipeline job for only aws solutions owned repo
gsingh04 Dec 9, 2022
3912c4d
Run unit test workflow on push in forks
gsingh04 Dec 20, 2022
5ae1ee4
Fix workflow file syntax
gsingh04 Dec 20, 2022
7201343
Run workflow with push on forks
gsingh04 Dec 20, 2022
b6c02f4
Merge pull request #402 from gsingh04/develop
gsingh04 Dec 20, 2022
4d989bc
Address eslint, CodeQL recommendations and issues
Dec 23, 2022
d0ead90
Merge pull request #413 from dougtoppin/feature/eslint
dougtoppin Dec 23, 2022
50ad5e8
Add package-lock to gitignore
Dec 28, 2022
130afa6
Merge branch 'develop' into chore/ignore-package-lock
dougtoppin Dec 28, 2022
c71bc7e
Add pipeline related configuration files
Jan 4, 2023
025e81d
Merge pull request #419 from aws-solutions/chore/pipeline-config
dougtoppin Jan 5, 2023
8cfd4a3
Merge branch 'develop' into chore/ignore-package-lock
dougtoppin Jan 6, 2023
c72ba3b
Merge pull request #415 from aws-solutions/chore/ignore-package-lock
dougtoppin Jan 6, 2023
75c6b24
chore(docs): Update contributing for develop branch and PR steps (#421)
dougtoppin Jan 13, 2023
e4689f5
Resolve #416 demo-ui unicode support (#422)
dougtoppin Jan 17, 2023
66fa67a
Update code-style-lint.yml (#425)
gsingh04 Jan 18, 2023
4ea6c93
chore(package-lock): Add package dependency files (#426)
dougtoppin Jan 19, 2023
f69392b
Bump json5 from 1.0.1 to 1.0.2 in /source (#428)
dependabot[bot] Jan 19, 2023
1659062
CHANGELOG additions and version set to 6.1.1 (#431)
dougtoppin Jan 23, 2023
d5f9f5d
Update CHANGELOG.md
dougtoppin Feb 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add pipeline related configuration files
  • Loading branch information
Doug Toppin committed Jan 4, 2023
commit c71bc7e714ba65ad1c7bb9657b1bc44c172437bc
35 changes: 35 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 0.2

phases:
install:
runtime-versions:
nodejs: 16
pre_build:
commands:
- npm install -g [email protected]
- echo "Installing dependencies and executing unit tests - `pwd`"
- cd deployment && chmod +x ./run-unit-tests.sh && ./run-unit-tests.sh
- echo "Installing dependencies and executing unit tests completed `date`"
build:
commands:
- echo "Starting build `date` in `pwd`"
- chmod +x ./build-s3-dist.sh && ./build-s3-dist.sh $DIST_OUTPUT_BUCKET $SOLUTION_NAME $VERSION
- echo "Build completed `date`"
- echo "Starting open-source-dist `date` in `pwd`"
- chmod +x ./build-open-source-dist.sh && ./build-open-source-dist.sh $SOLUTION_NAME
- echo "Open Source Dist completed `date`"
post_build:
commands:
- echo "Retrieving next stage buildspec `date` in `pwd`"
- aws s3 cp s3://solutions-build-assets/changelog-spec.yml ../buildspec.yml
- echo "Retrieving next stage buildspec complete"
- echo "Post build completed on `date`"

artifacts:
files:
- deployment/**/*
- source/**/*
- CHANGELOG.md
- buildspec.yml
- sonar-project.properties
- .gitignore
78 changes: 78 additions & 0 deletions deployment/build-open-source-dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with a no-op file, pipeline currently only looks for the file

#
# 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-open-source-dist.sh solution-name
#
# Parameters:
# - solution-name: name of the solution for consistency

# Check to see if input has been provided:
if [ -z "$1" ]; then
echo "Please provide the trademark approved solution name for the open source package."
echo "For example: ./build-open-source-dist.sh trademarked-solution-name"
exit 1
fi

# Get reference for all important folders
source_template_dir="$PWD"
dist_dir="$source_template_dir/open-source"
dist_template_dir="$dist_dir/deployment"
source_dir="$source_template_dir/../source"

echo "------------------------------------------------------------------------------"
echo "[Init] Clean old open-source folder"
echo "------------------------------------------------------------------------------"
rm -rf $dist_dir
mkdir -p $dist_dir
mkdir -p $dist_template_dir

echo "------------------------------------------------------------------------------"
echo "[Packing] Build Script"
echo "------------------------------------------------------------------------------"
cp $source_template_dir/build-s3-dist.sh $dist_template_dir
cp $source_template_dir/run-unit-tests.sh $dist_template_dir

echo "------------------------------------------------------------------------------"
echo "[Packing] Architecture diagram"
echo "------------------------------------------------------------------------------"
cp $source_template_dir/../architecture.png $dist_dir

echo "------------------------------------------------------------------------------"
echo "[Packing] Source folder and clean up the pacakge"
echo "------------------------------------------------------------------------------"
rsync -avq --progress $source_dir $dist_dir --exclude node_modules
find $dist_dir -iname "dist" -type d -exec rm -rf "{}" \; 2>/dev/null
find $dist_dir -iname "node_modules" -type d -exec rm -rf "{}" \; 2>/dev/null
find $dist_dir -iname "coverage" -type d -exec rm -rf "{}" \; 2>/dev/null
find $dist_dir -type f -name 'package-lock.json' -delete
find $dist_dir/source/constructs -iname "cdk.out" -type d -exec rm -rf "{}" \; 2>/dev/null
find $dist_dir -type f -name '.DS_Store' -delete

echo "------------------------------------------------------------------------------"
echo "Removing unit test coverage files used by SonarQube"
echo "------------------------------------------------------------------------------"
rm -rf $dist_dir/source/test

echo "------------------------------------------------------------------------------"
echo "[Packing] Root files"
echo "------------------------------------------------------------------------------"
cp $source_template_dir/../LICENSE.txt $dist_dir
cp $source_template_dir/../NOTICE.txt $dist_dir
cp $source_template_dir/../README.md $dist_dir
cp $source_template_dir/../CODE_OF_CONDUCT.md $dist_dir
cp $source_template_dir/../CONTRIBUTING.md $dist_dir
cp $source_template_dir/../CHANGELOG.md $dist_dir
cp $source_template_dir/../.gitignore $dist_dir
cp -r $source_template_dir/../.github $dist_dir

echo "------------------------------------------------------------------------------"
echo "Creating GitHub (open-source) zip file"
echo "------------------------------------------------------------------------------"
cd $dist_dir
zip -q -r9 ../$1.zip * .github .gitignore
rm -rf * .github .gitignore
mv ../$1.zip .
echo "Completed building $1.zip"
70 changes: 70 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Customize sonar.sources, sonar.exclusions, sonar.coverage.exclusions, sonar.tests and sonar
# unit test coverage reports based on your solutions

# Refer to https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/
# for details on sources and exclusions. Note also .gitignore
#
sonar.sources=source, deployment

# Focusing sonarqube analysis on non test code first and reducing noise from analysis of test code. Projects
# can customize the exclusions to include analyzing of test code if desired
sonar.exclusions= **/dist/**, \
deployment/**

# Code coverage Specific Properties
sonar.coverage.exclusions= **/jest.config.js, \
**/test/**, \
**/test*, \
source/demo-ui/**, \
source/constructs/bin/constructs.ts

# Ignoring duplications
sonar.cpd.exclusions=source/image-handler/test/**/*.ts, \
source/custom-resource/test/*.ts

# Ignoring following issues, false warnings
sonar.issue.ignore.multicriteria=e1, e2, e3, e4, e5, e6, e7, e8

# Enabling Cross-Origin Resource Sharing is security-sensitive.
sonar.issue.ignore.multicriteria.e1.ruleKey=typescript:S5122
sonar.issue.ignore.multicriteria.e1.resourceKey=source/image-handler/test/index.spec.ts

# Enabling Cross-Origin Resource Sharing is security-sensitive.
sonar.issue.ignore.multicriteria.e2.ruleKey=typescript:S5122
sonar.issue.ignore.multicriteria.e2.resourceKey=source/constructs/lib/serverless-image-stack.ts

# Enabling Cross-Origin Resource Sharing is security-sensitive.
sonar.issue.ignore.multicriteria.e3.ruleKey=typescript:S5122
sonar.issue.ignore.multicriteria.e3.resourceKey=source/image-handler/index.ts

# Using regular expressions is security-sensitive.
sonar.issue.ignore.multicriteria.e4.ruleKey=typescript:S4784
sonar.issue.ignore.multicriteria.e4.resourceKey=source/image-handler/thumbor-mapper.ts

# Hashing data is security-sensitive
sonar.issue.ignore.multicriteria.e5.ruleKey=typescript:S4790
sonar.issue.ignore.multicriteria.e5.resourceKey=source/custom-resource/index.ts

# Hashing data is security-sensitive
sonar.issue.ignore.multicriteria.e6.ruleKey=typescript:S4790
sonar.issue.ignore.multicriteria.e6.resourceKey=source/demo-ui/scripts.js

# Using regular expressions is security-sensitive.
sonar.issue.ignore.multicriteria.e7.ruleKey=typescript:S4784
sonar.issue.ignore.multicriteria.e7.resourceKey=source/image-handler/image-request.ts

# Using regular expressions is security-sensitive.
sonar.issue.ignore.multicriteria.e8.ruleKey=javascript:S4784
sonar.issue.ignore.multicriteria.e8.resourceKey=source/demo-ui/scripts.js

# Sensor SonarJS Coverage [javascript] was not allowing globbing
# for sonar.javascript.lcov.reportPaths such as this
# source/test/coverage-reports/jest/*/lcov.info
# so we have to provide an explicit list of reportPaths
sonar.javascript.lcov.reportPaths= \
source/test/coverage-reports/jest/constructs/lcov.info, \
source/test/coverage-reports/jest/custom-resource/lcov.info, \
source/test/coverage-reports/jest/image-handler/lcov.info

# Encoding of the source files
sonar.sourceEncoding=UTF-8