Skip to content

test-ci-bot/launcher-backend

 
 

Repository files navigation

Fabric8-Launcher Backend

Build Status Quality Gate

The launcher-backend is a Java EE 7 application exposing several JAX-RS endpoints to handle launching of application into Openshift. The backend runs within a WildFly Swarm container and is called from an Angular Front application responsible to collect from an end user the information needed to generate a Zip file containing a Maven project populated for an Eclipse Vert.x, Spring Boot, WildFly Swarm or Node.js container.

The OpenAPI 3.0 descriptor for these services are available at https://app.swaggerhub.com/apis/fabric8-launcher/backend/2.0.0

Setting up the environment

  • You have to setup environment variables before you start the back-end.

You can source, or use as an example, the environment script template located there: ./launcher-env-template.sh

$ source ./launcher-env-template.sh

KeyCloak adds authentication to the Launcher and secures services with minimum fuss. No need to deal with storing users or authenticating users. It's all available out of the box. For development only, you can choose to work without KeyCloak by changing the option in the environment script. If you are not using KeyCloak, you can find information on how to setup your git providers default credentials.

IDE Setup

  • Immutables - Setup your IDE for dealing with generated immutable classes see the online documentation. You have to build the project at least once for the classes to be generated or you will still get errors in the IDE.

Build and Run the Application

  • First follow the environment setup instructions.

  • Build this project:

$ mvn clean install
  • Run:
$ java -jar web/target/launcher-backend-swarm.jar

Then follow the front-end README to run the front-end.

Running with Docker

  • First follow the environment setup instructions.

  • Build and run:

$ ./docker.sh

This will build and run a Docker image that will work in the same way as if you were running it locally. So the frontend can connect to it in the same way.

Build and Run the Unit Tests

$ mvn clean install

Build and Run the Unit and Integration Tests

  • First follow the environment setup instructions.

  • To build the project and run the integration tests, allowing Maven to start the WildFly Swarm server:

$ mvn clean install -Pit
  • To skip building and just run the integration tests, allowing Maven to start the WildFly Swarm server:
$ mvn integration-test -Pit

Reindex the booster catalog

Run the following command, replace TOKEN with the value defined in the environment variable LAUNCHER_BACKEND_CATALOG_REINDEX_TOKEN. Doesn't need to be specified if the environment variable doesn't exist in the running environment:

    $ curl -v -H "Content-Type: application/json" -d '{}' -X POST  https://localhost:8180/api/launchpad/catalog/reindex\?token\=TOKEN

Setup git providers default credentials (No KeyCloak mode)

  • Log into GitHub and generate an access token for use here: -- https://github.com/settings/tokens
    • Set scopes
      • repo
      • admin:repo_hook
      • delete_repo
  • Run the following commands:
git config --global github.user "<replace with your github username>"
git config --global github.token "<replace with your github token>"
git config --global gitlab.user "<replace with your gitlab username>"
git config --global gitlab.token "<replace with your gitlab token>"
  • Log into Bitbucket and generate an application password for use here: -- https://bitbucket.org/account/admin/app-passwords
    • Activate permissions:
      • Account: Email, Read
      • Team: Read
      • Projects: Read
      • Repositories: Read, Write, Admin, Delete
      • Pull requests: Read
      • Issue: Read
      • Webhook: Read and write
  • Run the following commands:
git config --global bitbucket.user "<replace with your github username>"
git config --global bitbucket.password "<replace with your bitbucket application password>"

About

The fabric8-launcher backend

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 98.4%
  • Shell 1.6%