Clarify development commands

This commit is contained in:
Olivier Lacan 2023-03-07 18:40:37 -08:00
parent 912a61f8a1
commit bb9539bfca
3 changed files with 49 additions and 2 deletions

View File

@ -18,11 +18,17 @@ This repository generates https://keepachangelog.com/.
- `git clone https://github.com/olivierlacan/keep-a-changelog.git`
- `cd keep-a-changelog`
- `bundle install`
- `bundle exec middleman` starts the local development server at http://localhost:4567
- `bin/rake serve` starts a local development server at http://localhost:4567
which will reload with any local file changes
- `bin/rake build` runs middleman build with `--verbose` flag so build errors are
logged for easier debugging
### Deployment
- `bundle exec rake publish` builds and pushes to the `gh-pages` branch
- `bin/rake clean` can clean a corrupted `build/` directory in
case `publish` failed
- `bin/rake publish` builds and pushes to the `gh-pages` branch on GitHub so
the site is deployed to keepachangelog.com
### Translations

View File

@ -1,9 +1,21 @@
require "middleman-gh-pages"
desc "Preview build on localhost:4567 with live reload"
task :serve do
puts "Running local development server on http://localhost:4567"
system("bundle exec middleman serve")
end
desc "Build and publish to GitHub Pages"
task :deploy => :publish
desc "Clean build directory"
task :build do
puts "Build site into build/ directory, print any errors"
system("bundle exec middleman build --verbose")
end
desc "Detele the build directory"
task :clean do
puts "Cleaning build/ directory"
system("rm -rf build/")

29
bin/rake Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'rake' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
bundle_binstub = File.expand_path("../bundle", __FILE__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("rake", "rake")