Skip to content

deconst/presenter

Repository files navigation

Presenter

A Deconst component that assembles and returns completed HTML documents to end users.

Build Status Docker Repository on Quay.io

Installation

To develop locally, you'll need to install:

Then, you should copy env.example and save it as env. Open the file in your favorite text editor, and follow the included instructions to add values to each environment variable. They're all required.

Once you've filled in all the environment variables, use source to add them to your current Bash environment:

source ./env

And now you're ready to actually run the app! Just build the images and start the stack:

docker-compose build && docker-compose up -d

The app will run in the background until you run docker-compose stop. You can also run docker-compose logs to see what the app is doing.

The presenter portion of the app runs under nodemon, so the presenter will be restarted automatically every time you save a file that's part of its source code. Certain changes (like adding a dependency to package.json) will require you to rebuild and restart the container.

Deconst Dev Env in Kubernetes with Minikube

These instructions will create the resources necessary to run the deconst presenter service in a dev env in Kubernetes with Minikube.

  1. If necessary, deploy the content service

  2. Open a new shell

  3. Customize your environment settings

    cp env.example env
    ${EDITOR} env

    Edit the following environment variables.

    • DOCKER_IMAGE=kube-registry.kube-system.svc.cluster.local:31000/presenter:dev
      • If you want to use the production image instead, keep the default value and skip the next step
    • CONTENT_SERVICE_URL=http://content.deconst.svc.cluster.local:9000/
    • CONTROL_REPO_PATH=/tmp/control-repo
    • CONTROL_REPO_URL=https://github.com/deconst/deconst-docs-control.git
    • PRESENTED_URL_DOMAIN=deconst.horse
    source ./env
  4. Build a development Docker image

    eval $(minikube docker-env)
    docker build --tag kube-registry.kube-system.svc.cluster.local:31000/presenter:dev .
    docker push kube-registry.kube-system.svc.cluster.local:31000/presenter:dev
  5. Create resources

    script/template kubernetes/deployment.yaml | kubectl apply -f -
  6. Watch and wait for resources

    watch kubectl get pods --namespace deconst
  7. Test that the presenter and staging presenter services are nominally working

    curl $(minikube service --url --namespace deconst presenter)/version/
    curl $(minikube service --url --namespace deconst staging-presenter)/version/
  8. Deploy the deconst docs

  9. Delete resources

    kubectl delete deploy/presenter svc/presenter --namespace deconst
    kubectl delete deploy/staging-presenter svc/staging-presenter  --namespace deconst

About

Consumes the content store API to render HTML to humans

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published