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.
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.
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.
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.
To deploy the service on OpenShift you need to have OpenShift cluster running and access to a image 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
podman login quay.io
(in case you want to use quay as the image registry)
Then run:
make deploy