Giter Site home page Giter Site logo

basicwebapp's Introduction

Extreme Startup

For this exercise we will use an automated build pipeline to deploy a simple web application. We will use GitHub Actions and Heroku, which should be easy to set up.

Set Up A Build Pipeline

Fork our web app on GitHub, clone it and get it running locally

Fork this repo into your own GitHub account. Clone your fork locally and import the code into an IDE. It’s a Java / Gradle project.

Run the main() method in ServerApplication. You should see the app running at http://localhost:8080.

Push a change to trigger GitHub Actions

The repository contains a .github directory that configures a GitHub Actions build pipeline. The file .github/workflows/build.yml configures the build and deploy pipeline.

If you push a change to the Java code you should see the build pass, but the deploy stage will probably fail, as we need to set up a few more things.

If you aren’t familiar with build pipelines or GitHub Actions you can check the documentation online here: https://docs.github.com/en/actions / https://docs.github.com/en/actions/quickstart

Setting up deployment to the cloud

Create an account on Heroku at heroku.com (you’ll get a confirmation email etc). Create an app on Heroku (either through the web UI or by installing the command line client). Choose a unique name (e.g. we chose nameless-forest-60668 )

Setting up automatic deployment to Heroku with GitHub Actions

Get your Heroku API key and add it to GitHub as a secret variable for your build pipeline. You can view your Heroku API key by going to Account settings > API Key > Reveal. Add it by navigating to Settings > Secrets > Actions > New secret on your GitHub fork. Also add your App name and your e-mail address there.

Docs on GitHub secrets here: https://docs.github.com/en/actions/security-guides/encrypted-secrets

Make a change to your application (e.g. change some HTML in IndexPage). Commit, push and check it is deployed (e.g. at https://nameless-forest-60668.herokuapp.com/).

Pushing changes through the pipeline

Now make a change to QueryProcessor (and its corresponding unit test) to make the app respond to a new query. When the tests pass, commit, push, and deploy again. Try intentionally breaking the build to make sure that only successful builds are deployed.

basicwebapp's People

Contributors

strohgelaender avatar krusche 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.