Giter Site home page Giter Site logo

dipak-pawar / fabric8-toggles-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fabric8-services/fabric8-toggles-service

0.0 1.0 0.0 331 KB

the UI feature toggle service

License: Apache License 2.0

Dockerfile 0.40% Makefile 7.02% Go 90.89% Shell 1.69%

fabric8-toggles-service's Introduction

Fabric8 toggles service

Overview

The fabric8-toggles-service is the client service to run with the fabric8-toggles server. The server is heavily based on Unleash server, a feature toggle system, that gives you a great overview over all feature toggles across all your applications and services. It comes with official client implementations for Java, Node.js and Go.

fabric8-server defines 4 level of toggle configuration: internal, experimental, beta or released. The activation strategy is per userGroupId.

Using the admin console deployed with fabric8-toggle, you can easily move a feature from experimental to beta. This client makes use of the unleash Go SDK to connect to fabric8-toggles server.

You can see usage of the service in fabric8-ui.

Development

Build

The following guide is mainly targeted towards a Linux or macOS development machine.

Pre-requisites

Have the following installed on your machine:

go Install GoLang from 1.8+, set the environment variable GOPATH.

Get the code

$ git clone https://github.com/fabric8-services/fabric8-toggles-services $GOPATH/src/github.com/fabric8-services/fabric8-toggles-service

Build

To fetch the Go dependencies, generate code (GOA framework) and finally build the project you can type:

$ cd $GOPATH/src/github.com/fabric8-services/fabric8-toggles-service
$ make clean build

Run test

To run unit tests:

make build test

Docker build

  • build image from centos

make image
  • run your docker image in minishift

make deploy-minishift
  • Deploy locally:

F8_TOGGLES_URL=http://toggles-fabric8.192.168.64.4.xip.io/api F8_AUTH_URL=https://auth.prod-preview.openshift.io make run

where F8_TOGGLES_URL points to the exposed route on minishift and F8_AUTH_URL target prod-preview.

Configure

Configure unleash database

  • Go to fabric8-toggles-server admin console (ie: the unleash admin console) http://fabric8-toggles-fabric8.MINISHIFT_IP.nip.io

  • In strategy tab:

    • add a strategy with name enableByLevel with a parameter level, choose string for parameter type.

    • add a strategy with name enableByEmails with a parameter emails, choose list for parameter type.

  • Go to features list:

    • add a feature with name "Planner", give a description and add the newly created enableByLevel strategy, enter released.

    • add a feature with name Analyze, give a description and add the newly created enableByEmails strategy, enter your prod-preview and prod emails. for level. Enable the feature.

๐Ÿ“Ž
This is a temporary settings, the fabric8-server should bootstrap those values.

Test your service locally with a curl

  • For anonymous user

$ curl http://localhost:8080/api/features?names\=Planner
{
  "data": [
    {
      "attributes": {
        "description": "Planner's description",
        "enabled": true,
        "enablement-level": "released",
        "user-enabled": true
      },
      "id": "Planner",
      "type": "features"
    }
  ]
}
  • For logged-in user

$ export TOKEN=YOUT_TOKEN
$ curl http://localhost:8080/api/features\?group\=Analyze -H "Authorization: Bearer $TOKEN"

fabric8-toggles-service's People

Contributors

xcoulon avatar corinnekrych avatar jmelis avatar aslakknutsen avatar

Watchers

James Cloos 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.