Skip to content

Commit

Permalink
Replace Heroku instructions with Fly.io
Browse files Browse the repository at this point in the history
Also includes info on how to update the website to reflect event info.
  • Loading branch information
mxie committed Sep 10, 2023
1 parent b3419f1 commit 325ae1d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,27 @@ Running the app locally
$ bin/rails server
$ open http://localhost:3000/

Hiding registration
Showing registration
-------------------

Sometimes we create an event, make it live, but don't want people to sign up
yet. In that case we can set `ENV["HIDE_REGISTRATION]` to `"true"` on Heroku,
and the registration link won't be shown at all:
In order to show registration info, you'll need to set the following environment variables:

heroku config:set HIDE_REGISTRATION=true
* `EVENT_URL` - URL of the workshop signup
* `VENUE_NAME` - name of the venue
* `VENUE_ADDRESS` - one-liner full address of the venue
* `VENUE_MAP_URL` - an embedded map URL
* `HIDE_REGISTRATION=true`

Don't forget to un-hide it!
You can do this by running:
fly secrets set EVENT_URL=... VENUE_NAME=... ...

Using real event data
---------------------
This command will automatically redeploy the app for the new variables to go into effect.

If you'd like to work with actual Eventbrite data, you'll have to set the
`EVENTBRITE_ACCESS_TOKEN` variable to a real token in your `.env` file.

You can get this via `heroku config:get EVENTBRITE_ACCESS_TOKEN` if you have
Heroku access or from [Eventbrite App Management] if you have access to the
RailsBridge Boston Eventbrite account. Otherwise, ask a maintainer for access.
Sometimes we create an event, make it live, but don't want people to sign up
yet. In that case we can set `ENV["HIDE_REGISTRATION]` to `"true"` on Heroku,
and the registration link won't be shown at all:

[Eventbrite App Management]: http://www.eventbrite.com/myaccount/apps/
fly secrets set HIDE_REGISTRATION=true

Don't forget to un-hide it!
4 changes: 0 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ def signup_form_url
"//getform.io/f/170d6d2e-01ba-481a-a532-74405f3ed4bc"
end

def venue_map_url
ENV.fetch("VENUE_MAP_URL", "")
end

def data_links
@data_links ||= YAML.load_file(Rails.root.join("app/data/links.yml"))
end
Expand Down
7 changes: 5 additions & 2 deletions app/helpers/events_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ def next_event
venue: venue,
url: ENV.fetch("EVENT_URL", "")
)
# @next_event ||= Eventbrite::EventFinder.find(ENV.fetch("NEXT_EVENT_ID"))
end

def next_event_venue
next_event.venue
end

def venue
def venue
OpenStruct.new(
name: ENV.fetch("VENUE_NAME", ""),
address: ENV.fetch("VENUE_ADDRESS", "")
)
end

def venue_map_url
ENV.fetch("VENUE_MAP_URL", "")
end

def show_registration?
ENV["HIDE_REGISTRATION"] != "true" && next_event.url.present?
end
Expand Down

0 comments on commit 325ae1d

Please sign in to comment.