Skip to content

Commit

Permalink
Initial continuous integration setup (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfn-rpdk-ci authored Jan 11, 2021
1 parent 1c05c1d commit 010b5d8
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-case-conflict
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args:
- --fix=lf
- id: trailing-whitespace
- id: pretty-format-json
args:
- --autofix
- --indent=2
- --no-sort-keys
- id: check-merge-conflict
- id: check-yaml
exclude: codebuild-ci.yaml
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more inform
## License

This project is licensed under the Apache-2.0 License.

30 changes: 30 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 0.2
phases:
install:
runtime-versions:
java: openjdk8
python: 3.7
commands:
- pip install pre-commit cloudformation-cli-java-plugin
build:
commands:
- pre-commit run --all-files
- |
if [ "$(ls -A $CODEBUILD_SRC_DIR)" ]; then
cd $CODEBUILD_SRC_DIR
# skip hidden folders
dirs=$(find . -not -path "\./\.*" -mindepth 1 -maxdepth 1 -type d)
echo "Folders to build: $dirs"
for directory in $dirs; do
cd "$directory"
mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean verify --no-transfer-progress
if [ "$?" -ne 0 ] ; then
echo "Build failed!"
exit 1
else
cd ".."
fi
done
else
echo "$CODEBUILD_SRC_DIR is empty"
fi

0 comments on commit 010b5d8

Please sign in to comment.