Skip to content

Commit

Permalink
Merge pull request #350 from HSLdevcom/fix_log_flooding
Browse files Browse the repository at this point in the history
Fix log flooding
  • Loading branch information
optionsome authored Dec 4, 2020
2 parents 3b93987 + 27b27de commit 3c01067
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 70 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/dev-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Process master push or pr
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
docker-push:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build docker image from master and push it
run: ./.github/workflows/scripts/build_and_push_master.sh
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_AUTH: ${{ secrets.DOCKER_AUTH }}
23 changes: 23 additions & 0 deletions .github/workflows/prod-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build prod from release
on:
release:
types:
- published
jobs:
prod-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check Tag
id: check-tag
run: |
if [[ ${GITHUB_REF##*/} =~ ^202[0-9][0-1][0-9][0-3][0-9]$ ]]; then
echo ::set-output name=match::true
fi
- name: Push latest image as prod
if: steps.check-tag.outputs.match == 'true'
run: ./.github/workflows/scripts/push_prod.sh
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_AUTH: ${{ secrets.DOCKER_AUTH }}
25 changes: 25 additions & 0 deletions .github/workflows/scripts/build_and_push_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e

DOCKER_IMAGE="hsldevcom/opentripplanner"
DOCKER_TAG="latest"

COMMIT_HASH=$(git rev-parse --short "$GITHUB_SHA")

DOCKER_TAG_LONG=$DOCKER_TAG-$(date +"%Y-%m-%dT%H.%M.%S")-$COMMIT_HASH
DOCKER_IMAGE_TAG=$DOCKER_IMAGE:$DOCKER_TAG
DOCKER_IMAGE_TAG_LONG=$DOCKER_IMAGE:$DOCKER_TAG_LONG

# Build image
echo Building OTP
docker build --tag="$DOCKER_IMAGE:builder" -f Dockerfile.builder .
docker run --rm --entrypoint tar "$DOCKER_IMAGE:builder" -c target|tar x -C ./
docker build --tag="$DOCKER_IMAGE_TAG_LONG" -f Dockerfile .

docker login -u $DOCKER_USER -p $DOCKER_AUTH
echo "Pushing $DOCKER_TAG image"
docker push $DOCKER_IMAGE_TAG_LONG
docker tag $DOCKER_IMAGE_TAG_LONG $DOCKER_IMAGE_TAG
docker push $DOCKER_IMAGE_TAG

echo Build completed
23 changes: 23 additions & 0 deletions .github/workflows/scripts/push_prod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

DOCKER_IMAGE="hsldevcom/opentripplanner"
DOCKER_TAG="prod"

COMMIT_HASH=$(git rev-parse --short "$GITHUB_SHA")

DOCKER_TAG_LONG=$DOCKER_TAG-$(date +"%Y-%m-%dT%H.%M.%S")-$COMMIT_HASH
DOCKER_IMAGE_TAG=$DOCKER_IMAGE:$DOCKER_TAG
DOCKER_IMAGE_TAG_LONG=$DOCKER_IMAGE:$DOCKER_TAG_LONG
DOCKER_IMAGE_LATEST=$DOCKER_IMAGE:latest

docker login -u $DOCKER_USER -p $DOCKER_AUTH

echo "processing prod release"
docker pull $DOCKER_IMAGE_LATEST
docker tag $DOCKER_IMAGE_LATEST $DOCKER_IMAGE_TAG
docker tag $DOCKER_IMAGE_LATEST $DOCKER_IMAGE_TAG_LONG
docker push $DOCKER_IMAGE_TAG
docker push $DOCKER_IMAGE_TAG_LONG

echo Build completed
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ OpenTripPlanner (OTP) is an open source multi-modal trip planner. It depends on

The main Java server code is in `src/main/`. OTP also includes a Javascript client based on the Leaflet mapping library in `src/client/`. The Maven build produces a JAR file at `target/otp-VERSION.jar` containing all necessary code and dependencies to run OpenTripPlanner.

Additional information and instructions are available in the [main documentation](http://opentripplanner.readthedocs.org/en/latest/), including a
Additional information and instructions are available in the [main documentation](http://opentripplanner.readthedocs.org/en/latest/), including a
[quick introduction](http://opentripplanner.readthedocs.org/en/latest/Basic-Usage/).

[![Build Status](https://travis-ci.org/opentripplanner/OpenTripPlanner.svg?branch=master)](https://travis-ci.org/opentripplanner/OpenTripPlanner)
[![Build](https://github.com/hsldevcom/opentripplanner/workflows/Process%20master%20push%20or%20pr/badge.svg?branch=master)](https://github.com/HSLdevcom/opentripplanner/actions)

## Development
## Development

OpenTripPlanner is a collaborative project incorporating code, translation, and documentation from contributors around the world. We welcome new contributions and prefer to format our code according to GeoTools-based formatting guidelines; an Eclipse autoformatter can be found at the root of this project (https://raw.github.com/openplans/OpenTripPlanner/master/formatter.xml). Further [development guidelines](http://opentripplanner.readthedocs.org/en/latest/Developers-Guide/) can be found in the documentation.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public State makeState() {

// if something was flagged incorrect, do not make a new state
if (defectiveTraversal) {
LOG.error("Defective traversal flagged on edge " + child.backEdge);
LOG.debug("Defective traversal flagged on edge " + child.backEdge);
return null;
}

Expand Down Expand Up @@ -183,7 +183,7 @@ public void blockTraversal() {

public void incrementWeight(double weight) {
if (Double.isNaN(weight)) {
LOG.warn("A state's weight is being incremented by NaN while traversing edge "
LOG.debug("A state's weight is being incremented by NaN while traversing edge "
+ child.backEdge);
defectiveTraversal = true;
return;
Expand Down
52 changes: 0 additions & 52 deletions travis-build.sh

This file was deleted.

0 comments on commit 3c01067

Please sign in to comment.