GithubHelp home page GithubHelp logo

jbosstools / jbosstools-website Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 98.0 151.01 MB

jboss.org/tools website

Shell 1.91% Ruby 42.24% JavaScript 3.15% Dockerfile 0.81% Haml 38.27% SCSS 13.63%
hacktoberfest

jbosstools-website's Introduction

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..

The simplest way to use this is to use our automatically built docker image. See https://hub.docker.com/r/jbosstools/jbosstools-website/.

   $ docker pull jbosstools/jbosstools-website
   $ git clone https://github.com/jbosstools/jbosstools-website
   $ cd jbosstools-website
   $ docker run -it --rm -p 4242:4242 -v `pwd`:/jbosstools-website jbosstools/jbosstools-website /bin/bash
Warning
On Linux (SELinux, Fedora), you may experience permission issues inside the container on the jbosstools-website folder. Add a trailing :Z to the volume. The command will now be:
   $ docker run -it --rm -p 4242:4242 -v `pwd`:/jbosstools-website:Z jbosstools/jbosstools-website /bin/bash

Then, in the Docker container, do:

   # cd /jbosstools-website
   # yum install ruby -y # ONLY if required!
   # gem install bundler && bundle --version && bundle install # ONLY if required!
   # rake clean preview

and you can browse the result at http://$DOCKER_HOST:4242.

Everything else below is if you want to run awestruct "natively".

Prerequisites

  • Get Git

  • Get Ruby 2.4+ (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 2.4.1
rvm use 2.4.1
rvm gemset create jbosstools-website

Note: the project has a .ruby-gemset 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.

Next steps

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

If you are viewing this page while rendered locally this would be survivalguide.html instead.

Tips & Tricks

How to add a blog ?

To add a blog add a file to the blog folder, following the structure of this template

How to add New and Noteworthy

To add a new and noteworthy add a dir+file to the whatsnew folder, using one of the existing entries as a template.

Take care to ensure you have listed all the proper component and project versions and the site generation will automatically aggregate the news for the full release.

How do I exclude New and Noteworthy content from Final version ?

Sometimes a N&N in earlier versions are not appropriate in the Final release. To avoid having to manually create a full NN you can use a asciidoctor macro to skip content based on the finalnn property being defined.

Example:

ifndef::finalnn[]
== Really cool feature

This awesome feature is very dangerous and might be removed, but
for now it is in there.
endif::finalnn[]

If that is in version 1.0.0.Beta1 NN then it will still be listed in 1.0.0.Beta1 but for the 1.0.0.Final version it will not.

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 this github action when you publish to the 'main' or 'production' branch.

Build Status

If 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

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

jbosstools-website's People

Contributors

aasingh avatar adietish avatar alexeykazakov avatar apupier avatar cheyenneweaver avatar dependabot[bot] avatar dgolovin avatar fbricon avatar gastaldi avatar gorkem avatar ibuziuk avatar jeffmaury avatar jjohnstn avatar johnsteele avatar kmarmaliykov avatar koentsje avatar krisv avatar ldimaggi avatar lhein avatar maxandersen avatar michellemurray avatar mickaelistria avatar mishaone avatar mmalina avatar nickboldt avatar robstryker avatar sbouchet avatar snjeza avatar supriya-bharadwaj avatar xcoulon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jbosstools-website's Issues

undefined method `site' for nil:NilClass

When I run: awestruct -P production -s. I get plenty of errors about not rendered _project.html.haml layout. Maybe something with this newest Awestruct version?(just a guess).

In generated html files is a following error:

Rendering file /_layouts/project.html.haml resulted in a failure.

Line: unknown

Backtrace:

/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/extensions/partial.rb:21:in `partial'
/Users/rysiek/Work/jbosstools-website/_layouts/project.html.haml:4:in `block in singletonclass'
/Users/rysiek/Work/jbosstools-website/_layouts/project.html.haml:65528:in `instance_eval'
/Users/rysiek/Work/jbosstools-website/_layouts/project.html.haml:65528:in `singletonclass'
/Users/rysiek/Work/jbosstools-website/_layouts/project.html.haml:65526:in `__tilt_70206642928600'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `call'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/tilt-1.4.1/lib/tilt/template.rb:170:in `evaluate'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/tilt-1.4.1/lib/tilt/haml.rb:24:in `evaluate'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/handlers/base_tilt_handler.rb:130:in `rendered_content'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/handlers/layout_handler.rb:48:in `rendered_content'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/page.rb:135:in `rendered_content'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/handlers/layout_handler.rb:55:in `block in rendered_content'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/handlers/layout_handler.rb:41:in `call'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/handlers/layout_handler.rb:41:in `for_layout_chain'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/handlers/layout_handler.rb:52:in `rendered_content'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/page.rb:135:in `rendered_content'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/engine.rb:310:in `generate_page'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/engine.rb:298:in `block in generate_output'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/engine.rb:295:in `each'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/engine.rb:295:in `generate_output'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/engine.rb:74:in `run'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/cli/generate.rb:21:in `run'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/cli/invoker.rb:104:in `invoke_generate'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/lib/awestruct/cli/invoker.rb:47:in `invoke!'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/gems/awestruct-0.5.4.rc2/bin/awestruct:9:in `'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/bin/awestruct:23:in `load'
/Users/rysiek/.rvm/gems/ruby-1.9.3-p448@jbosstools/bin/awestruct:23:in `

A XML file containing only route context are not display at all in the design tab

The XML file importing the camel namespace is correctly recognized by the plugin (changing the file icon to a camel) but, since it is defining only route contexts nothing is shown on the design tab.
Source and Configuration ones are working fine though.

Following a file sample:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:arch="http://arch.ifis.it/schema/arch"
    xmlns:camel="http://camel.apache.org/schema/spring"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd    http://www.springframework.org/schema/mvc  http://www.springframework.org/schema/mvc/spring-mvc.xsd    http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd    http://arch.ifis.it/schema/arch http://arch.ifis.it/schema/arch-orchestration-1.0.xsd">
    <camel:routeContext id="immobili.compositeservicename.listaimmobili">
        <camel:route>
            <camel:from uri="direct:immobili.compositeservicename.listaimmobili"/>
            <camel:to uri="listaImmobili"/>
        </camel:route>
    </camel:routeContext>
    <camel:routeContext id="immobili.compositeservicename.listanoteconservatoria">
        <camel:route>
            <camel:from uri="direct:immobili.compositeservicename.listanoteconservatoria"/>
            <camel:to uri="listanoteconservatoria"/>
        </camel:route>
    </camel:routeContext>
...
...

Eclipse Version: Neon.1a Release (4.6.1) Build id: 20161007-1200
JBoss Fuse Tooling Apache Camel Editor Version: 9.0.0.Alpha1-v20160912-1906-B10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.