Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieun committed Aug 8, 2017
0 parents commit 47bc190
Show file tree
Hide file tree
Showing 157 changed files with 13,619 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*/build/
*/bin/
.classpath
.project
.settings
.checkstyle
.gradle
.out
.dist
*.ipr
*.iml
*.iws
*.ws~
.idea/
/tags
/build/
.DS_Store
**/.DS_Store
**/out/
/bin/
**/ignored/
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
env:
global:
- # GITHUB_SECRET_TOKEN
- secure: "Zb8ww8gZm8LrU335UTFkLZxPvsUmHerRDIJ5sEiyhHZEt+edk3vVVRJboxHLHfa+2tr9PfO2s0SmCXF55gd/D63ya8kt711Z9vixzxxQ1uiX56zB3LfHJy1CY7wwC8gQk2pZuqhFkwnL/4UMHD47ISkN1QO1zupyqVpcU1a1zGRl4zyM30MokosmybExJOrrwvoyYGUk1OGWjfpLiINNpyy3l0eu5H9Xyoc4wrtuVtvMEv55TeChRA3BVo7cfRKGxNZyMc/Mi12K9f3iM/CeCzvOI03XPU91rq35443iODMa4YwxaVCmmn4832nZNWOjHOwiVTEFciIDrGg2z8TP5jdOCyu2etYOMB3keba1DxfKu2XrDp1f8sdX1vLOdzu0m9kM+rmkekeo+7t3WnlCUJ41ri2KA38vYf5x0Et1KvnkqVINtZPuecNv8L173NIH79eGzoorLogOz87Jq8O9+r99nw00fpXBQmmhpDGBYAdVxOMSkXKj5Jn3FrR8kO8E/7Rr1MXSWGy7X7UPK2Sv8idbA7j0WkBuoIy4pPSohdz+cQQZXQVf2ovMx4g8KCcCFH6Uu3G4DfIdK4JRv8sGndH54yCMas7z0HG2pLBjI/CczHhEkEeQdLAJcH9L5hweiSKnGhZjozjpzO4Wj4IV5ZN+I6NpaRXSFO+tTws3TDU="
- # SONATYPE_USERNAME
- sec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maD67FsUXekrDWDmxtofmwaZZvfoRpSTw3ikCSB3QlT4c3SnnQmzzd6Eymi4upkLuazbawGH2tFyEEyPBWQUOIF7J3Fgqpv5TxnLgy2e9/Yc4DKz7RWi2Mxg9wyBPsu4sMzoU5TovRsYHeaKFGn39HOxPhLIm+4gCL6s44/od+wVPXb18IZCAEh3/A7bv5Dvz3XaTaeNpPnLXIH6I63iq5S1u5kMdI+wq5qZxc7auG3x/ujvYga0Aj76rjXvW/YODPN6wxMvH73OVdpsOrxR6qbrPWsjj/xf3v3HQBm5xXqVbqS3IhWlCSAWAWjS/mnbK3NgoS8l14vJtOxtOYSqwDlGtMlbZWKXKeGzVoXb+4bH26KfdOtKLwA9GeAfWYOBI+neJIrYKCnCWUeujD0VzDM7b9A//kmU0Z6wv9g+cYHNc9gyNFQUwpK1NfP7kssuHKcLAmKBMfZF8AgSaxvT71S0UsZCmtBC/rIQPzqwJvI1X8mq3QdV2Y98AwKN9fOS0r2kRXm9ZV0bbtWwhh5vI8hNlhcOXF+yZwgVXCaPKXvEWLNJ7/awGpA1tptn7aP8A6tDSsLNoE1e7NE2p1r+3BAEIklv27RQKzkKkMi8cFcq9gsl49y6wbd4z5IgZsbirkbpKoOvLNYfMUE="
- GPG_KEY_LOCATION=".travis/secring.gpg"
- ENCRYPTED_GPG_KEY_LOCATION=".travis/secring.gpg.enc"
branches:
only:
- master
- dev
language: java
jdk:
- oraclejdk8
before_install:
- chmod -R ug+x .travis
- .travis/install.sh
script:
- chmod -R ug+x .travis
- .travis/build.sh
- .travis/merge-dev-to-master-gate.sh
- .travis/deploy-gate.sh
- .travis/tag-master-gate.sh
21 changes: 21 additions & 0 deletions .travis/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env sh

chmod u+x gradlew

if [ "$MANUAL_RELEASE_TRIGGERED" = "true" ];
then
# This is a release job, triggered manually
# Change the version locally to remove the -SNAPSHOT
sed -i "s/-SNAPSHOT//g" gradle.properties
echo "This is a manual release!"
else
echo "Not a manual release"
fi

if [ "$TRAVIS_PULL_REQUEST" != "false" ];
then
echo "Skip integration tests in pull request builds"
./gradlew clean build -x integrationTest
else
./gradlew clean build
fi
11 changes: 11 additions & 0 deletions .travis/deploy-gate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

if [ $TRAVIS_TEST_RESULT -eq 0 ];
then
.travis/deploy.sh
RETURN_VALUE=$?
if [ "$RETURN_VALUE" != "0" ];
then
exit $RETURN_VALUE
fi
fi
14 changes: 14 additions & 0 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env sh

if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ];
then
echo "Sign Archives"
./gradlew signArchives
echo "Upload Archives"
./gradlew uploadArchives
if [ "$MANUAL_RELEASE_TRIGGERED" = "true" ];
then
echo "Promote repository"
./gradlew closeAndReleaseRepository
fi
fi
6 changes: 6 additions & 0 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh

if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ];
then
openssl aes-256-cbc -K $encrypted_188d9cfa26f4_key -iv $encrypted_188d9cfa26f4_iv -in $ENCRYPTED_GPG_KEY_LOCATION -out $GPG_KEY_LOCATION -d
fi
11 changes: 11 additions & 0 deletions .travis/merge-dev-to-master-gate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

if [ $TRAVIS_TEST_RESULT -eq 0 ];
then
.travis/merge-dev-to-master.sh
RETURN_VALUE=$?
if [ "$RETURN_VALUE" != "0" ];
then
exit $RETURN_VALUE
fi
fi
45 changes: 45 additions & 0 deletions .travis/merge-dev-to-master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env sh

GITHUB_REPO="osmlab/atlas-checks"
MERGE_BRANCH=master
SOURCE_BRANCH=dev

FUNCTION_NAME="merge-$SOURCE_BRANCH-to-$MERGE_BRANCH"

echo "$FUNCTION_NAME: $GITHUB_REPO"
echo "$FUNCTION_NAME: TRAVIS_BRANCH = $TRAVIS_BRANCH"
echo "$FUNCTION_NAME: TRAVIS_PULL_REQUEST = $TRAVIS_PULL_REQUEST"

if [ "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ];
then
echo "$FUNCTION_NAME: Exiting! Branch is not $SOURCE_BRANCH: ($TRAVIS_BRANCH)"
exit 0;
fi

if [ "$TRAVIS_PULL_REQUEST" != "false" ];
then
echo "$FUNCTION_NAME: Exiting! This is a Pull Request: $TRAVIS_PULL_REQUEST"
exit 0;
fi

: ${GITHUB_SECRET_TOKEN:?"GITHUB_SECRET_TOKEN needs to be set in .travis.yml!"}

export GIT_COMMITTER_EMAIL="[email protected]"
export GIT_COMMITTER_NAME="Travis CI"

TEMPORARY_REPOSITORY=$(mktemp -d)
git clone "https://github.com/$GITHUB_REPO" "$TEMPORARY_REPOSITORY"
cd $TEMPORARY_REPOSITORY

echo "Checking out $SOURCE_BRANCH"
git checkout $SOURCE_BRANCH

echo "Checking out $MERGE_BRANCH"
git checkout $MERGE_BRANCH

echo "Merging $SOURCE_BRANCH into $MERGE_BRANCH"
git merge --ff-only "$SOURCE_BRANCH"

echo "Pushing to $GITHUB_REPO"
# Redirect to /dev/null to avoid secret leakage
git push "https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO" $MERGE_BRANCH > /dev/null 2>&1
Binary file added .travis/secring.gpg.enc
Binary file not shown.
11 changes: 11 additions & 0 deletions .travis/tag-master-gate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

if [ $TRAVIS_TEST_RESULT -eq 0 ];
then
.travis/tag-master.sh
RETURN_VALUE=$?
if [ "$RETURN_VALUE" != "0" ];
then
exit $RETURN_VALUE
fi
fi
50 changes: 50 additions & 0 deletions .travis/tag-master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env sh

GITHUB_REPO="osmlab/atlas-checks"
RELEASE_BRANCH=master

FUNCTION_NAME="tag-$RELEASE_BRANCH"

echo "$FUNCTION_NAME: $GITHUB_REPO"
echo "$FUNCTION_NAME: TRAVIS_BRANCH = $TRAVIS_BRANCH"
echo "$FUNCTION_NAME: TRAVIS_PULL_REQUEST = $TRAVIS_PULL_REQUEST"

if [ "$TRAVIS_BRANCH" != "$RELEASE_BRANCH" ];
then
echo "$FUNCTION_NAME: Exiting! Branch is not $RELEASE_BRANCH: ($TRAVIS_BRANCH)"
exit 0;
fi

if [ "$TRAVIS_PULL_REQUEST" != "false" ];
then
echo "$FUNCTION_NAME: Exiting! This is a Pull Request: $TRAVIS_PULL_REQUEST"
exit 0;
fi

if [ "$MANUAL_RELEASE_TRIGGERED" != "true" ];
then
echo "$FUNCTION_NAME: Exiting! This is not a release build."
exit 0;
fi

: ${GITHUB_SECRET_TOKEN:?"GITHUB_SECRET_TOKEN needs to be set in .travis.yml!"}

export GIT_COMMITTER_EMAIL="[email protected]"
export GIT_COMMITTER_NAME="Travis CI"

TEMPORARY_REPOSITORY=$(mktemp -d)
git clone "https://github.com/$GITHUB_REPO" "$TEMPORARY_REPOSITORY"
cd $TEMPORARY_REPOSITORY

echo "Checking out $RELEASE_BRANCH"
git checkout $RELEASE_BRANCH

PROJECT_VERSION=$(cat gradle.properties | grep "\-SNAPSHOT" | awk -F '=' '{print $2}' | awk -F '-' '{print $1}')
: ${PROJECT_VERSION:?"PROJECT_VERSION could not be found."}

echo "Tagging $RELEASE_BRANCH at version $PROJECT_VERSION"
git tag -a $PROJECT_VERSION -m "Release $PROJECT_VERSION"

echo "Pushing tag $PROJECT_VERSION to $GITHUB_REPO"
# Redirect to /dev/null to avoid secret leakage
git push "https://$GITHUB_SECRET_TOKEN@github.com/$GITHUB_REPO" $PROJECT_VERSION > /dev/null 2>&1
35 changes: 35 additions & 0 deletions .travis/trigger-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env sh

# Use Travis to trigger a release from Master

GITHUB_ORGANIZATION=osmlab
GITHUB_REPOSITORY_NAME=atlas-checks

# Assumptions
# - This is called from the root of the project
# - The travis client is installed: gem install travis
# - travis login --org has been called to authenticate

TRAVIS_PERSONAL_TOKEN=$(travis token)

:${TRAVIS_PERSONAL_TOKEN:?"TRAVIS_PERSONAL_TOKEN needs to be set to access the Travis API to trigger the build"}

body='
{
"request":
{
"branch": "master",
"config":
{
"before_script": "export MANUAL_RELEASE_TRIGGERED=true"
}
}
}'

curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token $TRAVIS_PERSONAL_TOKEN" \
-d "$body" \
https://api.travis-ci.org/repo/$GITHUB_ORGANIZATION%2F$GITHUB_REPOSITORY_NAME/requests
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2015-2017, Apple Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder(s) nor the names of any
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Altas Checks
The Atlas Checks framework and standalone application are tools to enable quality assurance of Atlas data files. For more information on the Atlas mapping file format please see the [Atlas project](http://github.com/osmlab/atlas) in Github.

## Starting with Atlas Checks

Please see the [contributing guidelines](https://github.com/osmlab/atlas/blob/dev/CONTRIBUTING.md)!

### Requirements
To run Atlas Checks the following is required:
1. [Java 8 JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
2. [Gradle](https://gradle.org/install)
3. [Git Command Line Tools](https://git-scm.com/downloads)

### Run Atlas Checks
To start working with Checks follow the steps below:
1. Clone Atlas Checks project using following command `git clone https://github.com/osmlab/atlas-checks.git`
2. Switch to newly created directory: `cd atlas-checks`
3. Execute `gradle run`

This command will build and run Atlas Checks with all the default options against the country Anguilla. GeoJSON output will be be produced that contains all the results found from the run. For more information on running Atlas Checks as a standalone application click [here](docs/standalone.md).

## Working with Configuration
See [configuration docs](docs/configuration.md) for more information about the configuration files that can be used to define specific details around the Atlas Checks application.

## Running Atlas Checks in Spark Cluster
Atlas Checks have been developed to take advantage of distributed computing by running the checks in Spark. For more information on Spark see [spark.apache.org](http://spark.apache.org/). Running Atlas Checks locally is already executed within a local Spark environment on your machine, so running Spark in a cluster is simply a matter of updating the configuration. For more information see [Running Atlas Checks in a Spark Cluster](docs/cluster.md)

## Developing your own Atlas Checks
See [Development docs](docs/dev.md) for more information about developing and best practices for new Atlas Checks.

## Docker Sandbox
We have also built a docker sandbox that you can use to execute the current checks. For more information click [here](docs/sandbox.md)

## Currently Available Checks

- [PoolSizeCheck](docs/tutorials/tutorial1-PoolSizeCheck.md)
- [BuildingRoadIntersectionCheck](docs/checks/buildingRoadIntersectionCheck.md)
- [SelfIntersectingPolylineCheck](docs/checks/selfIntersectingPolylineCheck.md)
- [FloatingEdgeCheck](docs/checks/floatingEdgeCheck.md)
- [RoundAboutClosedLoopCheck](docs/checks/roundaboutClosedLoopCheck.md)
- [SharpAngleCheck](docs/checks/sharpAngleCheck.md)
- [SinkIslandCheck](docs/tutorials/tutorial3-SinkIslandCheck.md)
- [SnakeRoadCheck](docs/checks/snakeRoadCheck.md)
- [DuplicateNodeCheck](docs/checks/duplicateNodeCheck.md)
- [OrphanNodeCheck](docs/tutorials/tutorial2-OrphanNodeCheck.md)
Loading

0 comments on commit 47bc190

Please sign in to comment.