Skip to content

Instantly share code, notes, and snippets.

@YesThatAllen
Last active December 15, 2020 13:14
Show Gist options
  • Save YesThatAllen/52bd6c9d661a5c693b35 to your computer and use it in GitHub Desktop.
Save YesThatAllen/52bd6c9d661a5c693b35 to your computer and use it in GitHub Desktop.
Rake tasks in Discourse as of April 13, 2017
# /var/discourse# ./launcher enter app
# RAILS_ENV=production bundle exec rake -T
rake about # List versions of all Rails frameworks and the environment
rake add_topic_to_quotes # Add the topic to quotes
rake admin:create # Creates a forum administrator
rake admin:invite[email] # invite an admin to this discourse instance
rake api_key:get # generate api key if missing, return existing if already there
rake assets:clean[keep] # Remove old compiled assets
rake assets:clobber # Remove compiled assets
rake assets:environment # Load asset compile environment
rake assets:precompile # Compile all the assets named in config.assets.precompile
rake assets:prestage # pre-stage assets on cdn
rake autospec # Run all specs automatically as needed
rake avatars:clean # Clean up all avatar thumbnails (use this when the thumbnail algorithm changes)
rake avatars:refresh # Refresh all avatars (download missing gravatars, refresh system)
rake build:stamp # stamp the current build with the git hash placed in version.rb
rake build_test_topic # create pushstate/replacestate test topic
rake cache_digests:dependencies # Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_comment...
rake cache_digests:nested_dependencies # Lookup nested dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rake db:create # Creates the database from DATABASE_URL or config/database.yml for the current RAILS_E...
rake db:drop # Drops the database from DATABASE_URL or config/database.yml for the current RAILS_ENV...
rake db:fixtures:load # Load fixtures into the current environment's database
rake db:migrate # Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
rake db:migrate:status # Display status of migrations
rake db:rebuild_indexes # Rebuild indexes
rake db:rollback # Rolls the schema back to the previous version (specify steps w/ STEP=n)
rake db:schema:cache:clear # Clear a db/schema_cache.dump file
rake db:schema:cache:dump # Create a db/schema_cache.dump file
rake db:schema:dump # Create a db/schema.rb file that is portable against any DB supported by AR
rake db:schema:load # Load a schema.rb file into the database
rake db:seed # Load the seed data from db/seeds.rb
rake db:seed_fu # Loads seed data for the current environment
rake db:setup # Create the database, load the schema, and initialize with the seed data (use db:reset...
rake db:structure:load # Recreate the databases from the structure.sql file
rake db:version # Retrieves the current schema version number
rake doc:app # Generate docs for the app -- also available doc:rails, doc:guides (options: TEMPLATE=...
rake docker:test # Run all tests (JS and code in a standalone environment)
rake emails:import # use this task to import a mailbox into Disourse
rake emoji:update # update emoji images
rake enqueue_digest_emails # This task is called by the Heroku scheduler add-on
rake highlightjs:update # download latest version of highlight and prepare it
rake i18n:stats # show the current translation status
rake integration:create_fixtures # Creates the integration fixtures
rake log:clear # Truncates all *.log files in log/ to zero bytes (specify which logs with LOGS=test,de...
rake middleware # Prints out your Rack middleware stack
rake multisite:generate:config # generate multisite config file (if missing)
rake multisite:migrate # migrate all sites in tier
rake multisite:rollback # rollback migrations for all sites in tier
rake notes # Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)
rake notes:custom # Enumerate a custom annotation, specify with ANNOTATION=CUSTOM
rake plugin:install[repo] # install plugin
rake plugin:spec[plugin] # run plugin specs
rake plugin:update[plugin] # update a plugin
rake plugin:update_all # update all plugins
rake poll:migrate_old_polls # Migrate old polls to new syntax
rake posts:delete_word[find] # Delete occurrence of a word/string
rake posts:fix_letter_avatars # Rebake all posts with a quote using a letter_avatar
rake posts:normalize_code # normalize all markdown so <pre><code> is not used and instead backticks
rake posts:rebake # Update each post with latest markdown
rake posts:rebake_match[pattern,type,delay] # Rebake all posts matching string/regex and optionally delay the loop
rake posts:refresh_oneboxes # Update each post with latest markdown and refresh oneboxes
rake posts:remap[find,replace] # Remap all posts matching specific string
rake qunit:test[timeout] # Runs the qunit test suite
rake rails:template # Applies the template supplied by LOCATION=(/path/to/template) or URL
rake rails:update # Update configs and some other initially generated files (or use just update:configs o...
rake release_note:generate[from,to] # generate a release note from the important commits
rake routes # Print out all defined routes in match order, with names
rake secret # Generate a cryptographically secure secret key (this is typically used to generate a ...
rake smoke:test # run phantomjs based smoke tests on current build
rake stats # Report code statistics (KLOCs, etc) from the application or engine
rake test # Runs all tests in test folder
rake test:all # Run tests quickly by merging all types and not resetting db
rake test:all:db # Run tests quickly, but also reset db
rake test:db # Run tests quickly, but also reset db
rake time:zones:all # Displays all time zones, also available: time:zones:us, time:zones:local -- filter wi...
rake tmp:clear # Clear session, cache, and socket files from tmp/ (narrow w/ tmp:sessions:clear, tmp:c...
rake tmp:create # Creates tmp directories for sessions, cache, sockets, and pids
rake user_actions:rebuild # rebuild the user_actions table
rake users:change_post_ownership[old_username,new_username,archetype] # Change topic/post ownership of all the topics/posts by a specific user (without creat...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment