Unleash-server bundled for OpenShift deployment. Loosely based on https://github.com/Unleash/unleash-docker
2 options to run the DB:
-
either Deploy on minishift see toggles-db.yml
-
or run locally postgres
-
Test in dev mode without GH auth/authz
DEV_MODE=true DATABASE_URL=postgres://user:password@MINISHIFT_IP:31210/unleashdb npm start
where MINISHIFT_IP is where you DB is deployed and 31210 the port where it’s running. It could be minishift or locally.
-
Debug
DEV_MODE=true DATABASE_URL=postgres://user:password@MINISHIFT_IP:31210/unleashdb npm run start:debug
Open chrome with chrome://inspect
and choose Remote Target to open a chrome too.
You need to configure GH OAuth app to test it locally:
-
Go to OAuth app
-
Create a new developer application, in the
Authorization callback URL
, -
Enter the url
http://localhost:4242/api/auth/callback
.
You’ll get a page with GITHUB_CLIENT_ID
and GITHUB_CLIENT_SECRET
.
NoteThe URL you enter should should match the env variable GITHUB_CALLBACK_URL
you’ll use to start the server
-
Install Minishift
-
Install OpenShift command oc
-
Start minishift
minishift start --memory=7000 --cpus=4 --disk-size=50g
on macOS:
minishift start --vm-driver=xhyve --memory=7000 --cpus=4 --disk-size=50g
-
Point
oc
to Minishift
oc config use-context minishift
oc login -u developer -p developer
(optional) if you want to start deleting any existing fabric8
project in your minishift:
make clean-minishift
and once ready:
make push-minishift
NoteTo check the image was pushed to your minishift internal repo: eval $(minishift docker-env)
anddocker images
As pre-requisites, make sure you have your GH OAuth app created.
GITHUB_CLIENT_ID=XXX GITHUB_CLIENT_SECRET=YYY GITHUB_CALLBACK_URL=http://toggles-fabric8.192.168.64.6.nip.io/api/auth/callback TOGGLES_ORG=push.registry.devshift.net/fabric8-services GITHUB_ORG=rhdt-toggles-test GITHUB_TEAM=toggles-admin-test TOGGLES_CONTEXT='' make deploy-minishift
to deploy to minishift using the CI?/CD image.
NOTE 1: If you want to use CI/CD image run
TOGGLES_ORG=registry.devshift.net/fabric8-services/fabric8-toggles make deploy-minishift
NOTE 2: Pre-fix the target with relevant env variables:
-
either with auth:
GITHUB_CLIENT_ID
,GITHUB_CLIENT_SECRET
,GITHUB_CLIENT_SECRET
,GITHUB_CALLBACK_URL
,GITHUB_ORG
,GITHUB_TEAM
. -
or without auth:
DEV_MODE
fabric8-toggles
is a wrapper around unleash-server which depends on unleash-frontend upstream projects.
When we need different release cycle we use forked npm releases until upstream projects released latest content.
npm login
npm publish
Notemake sure unleash-server is pointing to your unleash-frontend release.