The easiest possible way to add a new channel is to find the Omniauth gem for the specified integration. A few examples include omniauth-soundcloud, omniauth-github, or omniauth-facebook
-
Add the gem to the Gemfile
-
Run bundle install
-
Run
rails generate property INTEGRATION_channel_details
(Note: replaceINTEGRATION
with the name of the integration, e.g. github, soundcloud, vimeo, etc) -
Run
rails db:migrate
-
Register a new route in config/initializers/devise.rb
-
Add a new controller method in
app/controllers/publishers/omniauth_callbacks_controller.rb
similar toregister_github_channel
orregister_reddit_channel
-
Add the link and icon to
/app/views/application/_choose_channel_type.html.slim
-
Add translations in en.yml for
helpers.publisher.channel_type
andhelpers.publisher.channel_name
channel_type: youtube: YouTube channel website: Website <INTEGRATION>: Your <INTEGRATION> Name channel_name: youtube: YouTube website: the website <INTEGRATION>: <INTEGRATION> Name
-
Add assets for the new integration. Both a 32x32 png and a SVG of the logo.
Tests can be run on the container with
docker-compose run app rake test
Other one off commands can be run as above, but replacing rake test
. Note this spawns a new container.
Debugging with byebug and pry can be done by attaching to the running process. First get the container
id with docker ps
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
234f116cd942 publishers_app "foreman start --pro…" Less than a second ago Up 2 seconds 0.0.0.0:3000->3000/tcp publishers_app_1
b592d489a8d3 redis "docker-entrypoint.s…" 15 minutes ago Up 3 seconds 6379/tcp publishers_redis_1
f1c86172def7 schickling/mailcatcher "mailcatcher --no-qu…" 15 minutes ago Up 2 seconds 0.0.0.0:1025->1025/tcp, 0.0.0.0:1080->1080/tcp publishers_mailcatcher_1
Then attach to the container and you will hit your binding.pry
breakpoints
docker attach 234f116cd942
To connect with a bash shell on a running container use:
docker exec -i -t 234f116cd942 /bin/bash
root@234f116cd942:/var/www#
`