- Upon initialization of our Gitpod environment, we enabled the Sinatra Web Server to start in the
gitpod.yml
file, Gitpod Documentation, Close workspace, Restart workspace. - We run the web serveer by manually by executing the command
bundle exec ruby server.rb
. - All of the code for our server is stored in the
server.rb
file.
Bundler is a package manager for Ruby, it is the primary way to install Ruby packages(known as gems) for Ruby.
- You need to create a Gemfile and define your gems in that file.
source "https://rubygems.org"
gem 'sinatra'
gem 'rake'
gem 'pry'
gem 'puma'
gem 'activerecord'
- Then you run the
bundle install
command--(more likenpm install
), this will install the gems on the system globally(unlike nodejs which install packages in a node_modules directory).
- Use
bundle exec
to install future Ruby scripts, the command uses the gems we already installed.
- Sinatra is a micro web-framework for Ruby to build web-apps.
- Its great for mock or development servers/simple projects.
- You can create a web-server in a single file.
- Sinatra Reference.
- Replace the token with your actual token.
export TF_VAR_terratowns_access_token="token"
gp env export TF_VAR_terratowns_access_token="token"
- Replace the UUID with your Exampro Account UUID.
export TF_VAR_teacherseat_uuid="UUID"
gp env export TF_VAR_teacherseat_uuid="UUID"
- Set Custom Terraform Provider Endpoint
var.terratowns_endpoint
- Execute Custom Terraform Provider Script
./bin/build_provider
- Execute Terraform Commands
terraform init
terraform plan
terraform apply --auto-approve