steigr / kubyapp

A test Rails app that includes all the Kuby gems as git submodules. Facilitates development of the Kuby gem ecosystem.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KubyApp

A test Rails app that includes all the Kuby gems as git submodules. Facilitates development of the Kuby gem ecosystem.

Setup

  1. Check out submodules:

    git submodule update --init --recursive
  2. Install dependencies:

    bundle install

Running Locally

  1. Make sure you have Docker installed. If you're running MacOS or Windows, the easiest way is to download Docker Desktop.

  2. Make sure you have minikube running. Docker Desktop makes this easy: Preferences -> Kubernetes -> Enable Kubernetes.

  3. Set things up:

    bundle exec rake kuby:setup
  4. Build the Docker image locally:

    bundle exec rake kuby:build
  5. Deploy:

    bundle exec rake kuby:deploy
  6. Visit http://localhost:8080 to make sure it's working.

Running on DigitalOcean

  1. Create a Gitlab repo in order use the associated container registry.

  2. Create a personal Gitlab access token: https://gitlab.com/profile/personal_access_tokens.

  3. Create a DigitalOcean account and launch a Kubernetes cluster using the dashboard.

  4. Create a .env file with the following variables:

    KUBYAPP_DOCKER_USERNAME="???"
    KUBYAPP_DOCKER_PASSWORD="???"
    KUBYAPP_DOCKER_EMAIL="???"
    KUBYAPP_DIGITALOCEAN_ACCESS_TOKEN="???"
    KUBYAPP_DIGITALOCEAN_CLUSTER_ID="???"
    

    The Docker password should be the personal Gitlab access token you created.

  5. Build and push the Docker image:

    bundle exec rake kuby:build kuby:push
  6. Change the provider in config/initializers/kuby.rb:

    provider :digitalocean do
      access_token ENV['KUBYAPP_DIGITALOCEAN_ACCESS_TOKEN']
      cluster_id ENV['KUBYAPP_DIGITALOCEAN_CLUSTER_ID']
    end
  7. Set things up:

    bundle exec rake kuby:setup
  8. Deploy:

    bundle exec rake kuby:deploy
  9. The deploy should automatically create a DigitalOcean load balancer. Find it in the dashboard and visit its IP address. You should see the Rails app running.

About

A test Rails app that includes all the Kuby gems as git submodules. Facilitates development of the Kuby gem ecosystem.


Languages

Language:Ruby 80.7%Language:HTML 10.8%Language:JavaScript 7.2%Language:CSS 1.3%