A test Rails app that includes all the Kuby gems as git submodules. Facilitates development of the Kuby gem ecosystem.
-
Check out submodules:
git submodule update --init --recursive
-
Install dependencies:
bundle install
-
Make sure you have Docker installed. If you're running MacOS or Windows, the easiest way is to download Docker Desktop.
-
Make sure you have minikube running. Docker Desktop makes this easy: Preferences -> Kubernetes -> Enable Kubernetes.
-
Set things up:
bundle exec rake kuby:setup
-
Build the Docker image locally:
bundle exec rake kuby:build
-
Deploy:
bundle exec rake kuby:deploy
-
Visit http://localhost:8080 to make sure it's working.
-
Create a Gitlab repo in order use the associated container registry.
-
Create a personal Gitlab access token: https://gitlab.com/profile/personal_access_tokens.
-
Create a DigitalOcean account and launch a Kubernetes cluster using the dashboard.
-
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.
-
Build and push the Docker image:
bundle exec rake kuby:build kuby:push
-
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
-
Set things up:
bundle exec rake kuby:setup
-
Deploy:
bundle exec rake kuby:deploy
-
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.