Git Product home page Git Product logo

tyr's Introduction

Tyr

Powered by OpenShift Online

Pull request template status check

Development

  1. Build with Maven - mvn clean install
  2. Create a testing repository - for start you can fork my https://github.com/xstefank/test-repo where the PR template is set up or you can create your own :)
    • For creating new repository check the github manuals/help
    • PRs needs to be created to YOUR repository, you need to specify it under the base fork field in the Open a Pull Request page
  3. The project requires two properties to be set up to run correctly
    • GitHub OAuth token - can be passed as a MicroProfile Config property tyr.github.oauth.token
    • Configuration file specifying the format of the PR - the example can be found in tyr-runner/src/main/resources/format-example.yaml, the supported MicroProfile Config properties are tyr.template.format.file or tyr.template.format.url
  4. start Tyr - java -jar tyr-runner.jar with above MP config properties set (as for instance system properties, e.g. -Dtyr.template.format.file=/path/to/file)
  5. Expose local server instance with ngrok - https://ngrok.com/
    • Here you need to expose http port 8080 as the default application interface where the application runs, consult the ngrok documentation for the information of how to specify these arguments
  6. Now you should have everything prepared locally, next step is to let GitHub know where your Tyr instance runs
  7. Add a webhook for Tyr
    • In you test-repo - go to Settings -> Webhooks -> Add webhook
    • Fill in Payload URL -> your local exposed IP which is provided by ngrok + “/pull-request” (e. g., http://f202cf7c.ngrok.io/pull-request)
    • Fill in Content type -> application/json
    • Set Let me select individual events and check only Pull requests and Pull request review comments
    • Leave Active set and click “Add webhook”
    • Don’t worry about the error - the first JSON differs from what the subsequent PR JSONs will look like
  8. If you create a PR now (create a new branch based on master for instance) you should already see some output in the server logs
    • Be careful to which repository and branch you are doing the PR!!! You need to specify your repository, the point is to try to set up Tyr on your repository.
  9. However, you will still probably see problems with the custom PR check which the app is trying to send to GitHub as there is a requirement to provide an oauth token to the GitHub API
  10. Go to your profile -> settings (top right) -> Developer Settings -> Personal access tokens
  11. Generate new token
  12. Tick repo:status
  13. Generate token
  14. The last step is to let Tyr know what is the token value
    • add the token to config.properties file (the example is provided in the tyr-runner/src/main/resources folder) and copy this file to the same directory where Tyr is running
  15. Restart Tyr
  16. Rerun (update existing or create new PR) - everything should be working now
  17. If everything runs ok the PR should be updated with the valid error or green color, and in terminal where the server runs you’ll see Status update: 201

OpenShift deployment

This project contains an openshift profile to be easily deployable to Openshift platform.

To deploy to Openshift:

  1. login to your OS account (oc login)
  2. mvn fabric8:deploy -Popenshift

tyr's People

Contributors

xstefank avatar lukasburda avatar khermano avatar petrberan avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.