Skip to content

xcoulon/jbosstools-website

 
 

Repository files navigation

How to build tools.jboss.org

Build Status

A bit of Git, a bit of Ruby and you will get your local tools.jboss.org served..

Prerequisites

  • Get Git

  • Get Ruby 1.9.3 (part of the RVM install if you follow that path - see below)

  • Get RubyGems 1.3.6 or above

  • Get GNU Wget 1.14

  • If on Linux, you might need to install stuff for nokogiri (sudo yum install libxml libxml-devel libxslt libxslt-devel)

  • If on Linux, you need to install node.js for execjs ('sudo yum install nodejs')

  • If on Mac OS, get XCode (needed for native gems)

Installation

Git

Install Git to your system. GitHub’s help page is a good starting point. If you are looking for some tips and tricks, checkout Emmanuel’s blog.

Ruby (via RVM)

Ruby like many other platforms has its dependency hell. We do recommend you use RVM to isolate your ruby runtimes as well as dependencies (gems). The RVM steps are optional though. If you are not going to use RVM have a look at the different installations options you have.

Note: This installation varies per OS, see details on rvm.io.

For Linux/Fedora: \curl -sSL https://get.rvm.io | bash is the simplest and no root required). Note that for 'rvm' to be activated you need to run as a login shell. When running rvm it should tell you if you are running in a proper terminal/login.

  • Set up the isolated environment for the site

# Do *not* run these as root.
# The purpose of using rvm is to have non-root, user isolated and reproducible gem/ruby environment
# During the rvm install it might ask to install system level packages, for these your user need to have sudo permissions
# or you have to run those installs as root seperately and then run rvm install again as a normal user
rvm install 1.9.3
rvm use 1.9.3
rvm gemset create jbosstools-website

Note: the project has a .rvmrc file which will be used by rvm when you enter the jbosstools-website directory. This file will assume you have the above installed.

Get the source

Next, let’s retrieve the website.

git clone https://github.com/jbosstools/jbosstools-website
cd jbosstools-website

If you see a message like this:

Gemset 'jbosstools-website' does not exist, 'rvm gemset create jbosstools-website' first, or append '--create'.

Then it is because you have rvm installed and forgot to run the rvm setup above.

Install Ruby dependencies

This next step might take some time - it is installing all the required dependencies.

# do *not* run these as root
gem install bundler
bundle install

Note that if someone updates Awestruct or any dependent gem via the Gemfile dependency management, you need to rerun bundle install.

Serve the site locally

  • Run rake preview

  • If you see a message like Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes this means nodejs is not installed.

  • Wait for a message like [2014-01-06 11:48:01] INFO WEBrick::HTTPServer#start: pid=24294 port=4242 to appear in the console (can take a few tens of seconds)

  • Open your browser to http://localhost:4242

Any change will be automatically picked up except for changes to _partials files and changes in front-matters.

Note

You might see warnings at startup as follows:

WARNING: Missing required dependency to activate optional built-in extension coffeescripttransform.rb
  cannot load such file -- coffee-script
Using profile: development
Generating site: http://localhost:4242
Skipping files cache update.
CodeRay::Scanners could not load plugin :bash; falling back to :text
CodeRay::Scanners could not load plugin :bash; falling back to :text
CodeRay::Scanners could not load plugin :bash; falling back to :text
CodeRay::Scanners could not load plugin :bash; falling back to :text
CodeRay::Scanners could not load plugin :bash; falling back to :text
CodeRay::Scanners could not load plugin :bash; falling back to :text
[Listen warning]:
The blocking parameter of Listen::Listener#start is deprecated.
Please use Listen::Adapter#start for a non-blocking listener and Listen::Listener#start! for a blocking one.

That’s ok, it’s not your fault ;) It’s related to some Awestruct limitations.

guard and livereload

You can install the livereload extension to get instant refresh in your browser when pages are regenerated by running guard.

The dependencies should already be installed by the Gemfile thus you just need to start guard:

# run these as root
gem install guard guard-livereload
guard start

Install the LiveReload extension in your browser and click on the button next to the Location to activate the extension.

Chrome users can install the v.2.0.9 extension from the Chrome Marketplace.

Firefox users should use v. 2.0.9 or newer of the LiveReload extension available from here. If you hit an issue where the browser disconnects just after it has connected, which means the server cannot push refresh commands to it, you are using an old plugin and should update it.

Next steps

Using you local site, you can have a look at our survival guide to editing this website to get you started.

Tips & Tricks

If your changes are not visible…​

completely regenerate the site via:

rake clean[all] preview

If serving the site is slow…​

On Linux, serving the file may be atrociously slow (something to do with WEBRick).

Use the following alternative:

  • Go in your ~/jbosstools-website directory.

  • Run awestruct --auto -P development

  • In parallel, go to the ~/jbosstools-website/_site directory

  • Run python -m SimpleHTTPServer 4242

You should be back to millisecond serving :)

Publishing/Deploying

Publishing of the site is done automatically via Travis CI when you publish to the 'master' or 'production' branch.

Build Status

If Travis build successfully it will automatically publish the result to the proper site.

Profile parameters

In _config/site.yml various profiles are configured. The following table documents some of the important parameters.

Name Values Description

showwip

boolean

if true a banner will be shown on top indicating it is a work in progress.

License

The content of this repository is released under TBD. Sample code available on this website is released under EPL.

By submitting a "pull request" or otherwise contributing to this repository, you agree to license your contribution under the respective licenses mentioned above.

Acknowledgements

This website uses JBoss Community Bootstrap. This README.adoc was based on hibernate.org README.adoc

About

jboss.org/tools website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 58.6%
  • CSS 36.7%
  • JavaScript 3.9%
  • Shell 0.8%