We now have a Vagrant development environment available to make building & testing ComputeStacks even easier. With just a single virtual machine, you can run a fully working installation of ComputeStacks.
To get started, clone our controller to your local computer.
- Copy
envrc.sample
to.envrc
and update values appropriately.- Take note that the
GITHUB_GEM_PULL_TOKEN
is a personal access token with theread_packages
permission.
- Take note that the
- Copy
config/database.sample.yml
toconfig/database.yml
.- No changes are required.
- Copy
Vagrantfile.sample
toVagrantfile
and make any relevant changes, however it should work out of the box without any modification. - Bring up with
vagrant up
. This will take a few minutes depending on your computer – compiling ruby takes a bit.
Enter the vagrant VM with: vagrant ssh
-
Install NodeJS & Yarn
- Install nodejs with
nvm install --lts
- Install yarn
npm -g install yarn
- Install nodejs with
-
cd ~/controller
and run:direnv allow .
-
bundle
- if you did not setup your
.envrc
correctly, you will get an authorization error. Our provision script will automatically take the credentials in your.envrc
file and authenticate with Github, but please also reference this document if you run into issues: Working with the RubyGems registry - GitHub Docs
- if you did not setup your
-
Once all the gems have been installed, bootstrap your database with:
bundle exec rails db:create
bundle exec rails db:schema:load
bundle exec rails db:seed
-
Bootstrap the controller assets (from inside
~/controller
in vagrant)- Run
yarn
- Run
bundle exec rake assets:precompile
- Run
-
(optional) Install our default CS theme. Skip if you’re building your own.
mkdir ~/controller/public/assets/custom wget -q -O ~/controller/public/assets/custom/application.css https://storage.googleapis.com/cstacks/provision_assets/branding/application.css wget -q -O ~/controller/public/assets/custom/application.css.map https://storage.googleapis.com/cstacks/provision_assets/branding/application.css.map wget -q -O ~/controller/public/assets/custom/logo-login.png https://storage.googleapis.com/cstacks/provision_assets/branding/logo-login.png
-
(optional) Run our test suite with:
bundle exec rails test
You may now launch ComputeStacks by running overmind s
from the ~/controller directory within the vagrant vm.
Next, proceed to your browser and visit http://localhost:3005 – the default credentials are admin@cstacks.local
/ changeme!
To aid in your debugging efforts, the Vagrantfile will also forward Prometheus on port 9090
and consul on 8500
. The Consul token can be found in the vagrant virtual machine at /home/vagrant/consul.token
.