Giter VIP home page Giter VIP logo

generator-backend's Introduction

Fabric8 Generator Backend

This is the back end service for the fabric8-generator.

The backend runs within a WildFly Swarm container and is called from the fabric8-ui front end to create new apps or import projects from github.

Environment variables

To run this project you need to point the back end at KeyCloak and an OpenShift cluster.

You can point the back end at the production KeyCloak and OpenShift cluster via:

export OPENSHIFT_API_URL=https://api.starter-us-east-2.openshift.com:443
export KEYCLOAK_SAAS_URL=https://sso.openshift.io/

Then call ./run.sh or ./debug.sh as below.

Using Minishift

If you are running fabric8 locally on MiniShift then your local variables will be something like:

export OPENSHIFT_API_URL=https://`minishift ip`:8443
export KEYCLOAK_SAAS_URL="http://`oc get route keycloak --template={{.spec.host}} -n fabric8`/"
export WIT_URL="http://`oc get route wit --template={{.spec.host}} -n fabric8`/"
export AUTH_URL="http://`oc get route auth --template={{.spec.host}} -n fabric8`/"

Using Minikube

export OPENSHIFT_API_URL=https://`minikube ip`:8443
export KEYCLOAK_SAAS_URL="http://`kubectl get ingress -n fabric8 --template='{{ (index .spec.rules 0).host}}' f8tenant`/"
export WIT_URL="http://`kubectl get ingress -n fabric8 --template='{{ (index .spec.rules 0).host}}' wit`/"
export AUTH_URL="http://`kubectl get ingress -n fabric8 --template='{{ (index .spec.rules 0).host}}' auth`/"

Build this project:

$ ./build.sh

Debugging this project

$ ./debug.sh

Running this project

$ ./run.sh

Using fabric8-ui with a local build of fabric8-generator

To run fabric8-ui against a locally running/debugging Fabric8 Generator in the fabric8-ui project type:

cd fabric8-ui
source environments/openshift-prod-cluster.sh
export FABRIC8_FORGE_API_URL=http://localhost:8080
npm start

then open http://localhost:3000/ to use the local build of fabric8-ui which should now use your local Fabric8 Generator.

Using a local build of the fabric8-generator addon

When working on the fabric8-generator codebase you need to work with SNAPSHOT version of fabric8-generator add-ion.

In your swarm backend generator-backend use the generator-shapshot profile.

  • build fabric8-generator snapshot:
mvn install
  • build sawrm backend genrator-backend with the profile:
mvn install -Pgenerator-snapshot
  • run
./run.sh

or ./debug.sh will automatically reload the new version of your addon! This greatly speeds up development time!

Using a local fabric8-generator with MiniShift

Once you are running a local fabric8-generator you should be able to query it like this:

curl http://localhost:8080/forge/version
{"backendVersion":"1.0.0-SNAPSHOT","forgeVersion":"3.6.1.Final"}

How if you are running fabric8 locally on MiniShift you just need to point the console at your locally running process.

So first find out your local IP address via something like

ifconfig |grep inet | grep 192

Its probably something like 192.168.X.Y

First test you've got the right IP via:

curl http://192.168.X.Y:8080/forge/version

If that works then try edit the fabric8 ConfigMap to point at your local forge:

oc project fabric8
oc edit cm fabric8

Then

  • disable (delete or comment out)the annotation expose.service-key.config.fabric8.io/forge in metadata.annotations
  • edit the forge.api.url in the data: section to be http://192.168.X.Y:8080

You can test your edit worked by doing something like:

$ oc export cm | grep "forge.api.url:"
    forge.api.url: http://192.168.X.Y:8080

After you save change to the ConfigMap it should cause a redeploy of the fabric8 console. Then if you refresh your console you should be able to use the forge wizard against your locally running Forge process.

generator-backend's People

Contributors

alexeykazakov avatar bartoszmajsak avatar chmouel avatar cmoulliard avatar corinnekrych avatar edewit avatar fusesource-ci avatar gastaldi avatar jstrachan avatar pmuir avatar quintesse avatar rawlingsj avatar vpavlin avatar

Watchers

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