Giter Club home page Giter Club logo

devcluster's Introduction

DevCluster Service

Go Report Card GoDoc Go

This is the DevCluster Service repository

Build

Requires Go (version 1.14 or higher) - download for your development environment here.

This repository uses Go modules

To build, execute:

make build

This builds the executable with bundled assets. Only the binary needs to be deployed, all static assets are bundled with the binary.

To just generate the asset bundle, execute:

make generate

This creates the asset bundle in the static package. Do not change the asset bundle file(s), changes will be lost on the next build.

Development

To make development on the static content easier, a development binary can be built using:

make build-dev

The resulting binare does not use bundled assets but reads static content directly from pkg/assets. Do not deploy the dev binary.

Tests

Unit Tests

Run the unit tests by executing:

make test

Integration Tests

Integration tests require access to a test MongoDB database.

Set DEVCLUSTER_MONGODB_CONNECTION_STRING environment variable to your test MongoDB:

export DEVCLUSTER_MONGODB_CONNECTION_STRING="<connection_string>"

Run the integration tests by executing:

make test-integration

Tests are run with bundled assets, see above.

All Tests

Run all the integration and unit tests by executing:

make test-all

VSCode Testing/Debugging

To use the internal test runner and debug features of VSCode, you need to make sure that VSCode runs in a context where Go Modules are enabled. To do this, run:

export GO111MODULE=on

Before running VSCode from that shell.

Deploying on OpenShift

To deploy the service on OpenShift you need to have OpenShift cluster running and access to a docker registry. Before running any make target, make sure you have QUAY_NAMESPACE variable set to your quay username (or set to any namespace you want to push the image to).

$ export QUAY_NAMESPACE=<quay-username>

Set the target namespace:

$ export NAMESPACE=<Namespace-to-be-used-to-deploy-devcluster>

Then:

  • Make sure the target OpenShift cluster is accessible via oc command.

  • Log in to the target OpenShift cluster with with a user who has edit permissions in $NAMESPACE or has permissions to create $NAMESPACE

  • Login to quay.io via docker login quay.io (in case you want to use quay as the docker registry)

Then run:

make deploy

Deploying on minishift

To deploy DevCluster Service on local minishift, start your minishift then run:

eval $(minishift docker-env)
make deploy-on-minishift

The service can be accessed via the corresponding route:

$ oc get routes devcluster

NAME                   HOST/PORT                                         PATH      SERVICES               PORT      TERMINATION   WILDCARD
devcluster   devcluster-devcluster.192.168.42.237.nip.io             devcluster    8080                   None

You can now open the URL from HOST/PORT in your browser:

Note: the actual route/URL will be different in your minishift.

Note
If running in Minishift eval $(minishift docker-env) and eval $(minishift oc-env) are required. If running in CodeReady Containers eval $(crc oc-env) is required.

devcluster's People

Contributors

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