-
Notifications
You must be signed in to change notification settings - Fork 40
Setting up local website development
Also can be used to setup a local development environment when making changes to openliberty.io
- ruby
- gem
- node JS (https://nodejs.org/en/download/)
git clone [email protected]:OpenLiberty/openliberty.io.git
cd openliberty.io
Note If you run into issues installing gems, it is recommended to get RVM for Ruby management on your local machine. Run
\curl -sSL https://get.rvm.io | bash -s stable --ruby
to install RVM and then runrvm install 2.5.7
andrvm use 2.5.7 --default
to use the version of Ruby that the website uses.
gem install jekyll -v 3.8.6
gem install jekyll-assets -v 2.4.0
gem install bundler jekyll-feed jekyll-asciidoc jekyll-include-cache coderay uglifier octopress-minify-html octokit
pushd gems/ol-target-blank
gem build ol-target-blank.gemspec
gem install ol-target-blank-0.0.1.gem
popd
Note: You can find these commands in the build scripts here: https://github.com/OpenLiberty/openliberty.io/blob/prod/scripts/build/ruby_install.sh https://github.com/OpenLiberty/openliberty.io/blob/prod/scripts/build/jekyll.sh
In openliberty.io/src/main/content/_config.yml
set these values to false, css
, js
, minify_html
. The result should look like
assets:
compress:
css: false
js: false
env: production
minify_html: false
Run the Jekyll server locally
- ./scripts/jekyll_serve_dev.sh
- Go to http://localhost:4000/ to see the home page.
You can make changes to index.html. When you make changes, monitor your terminal for messages saying
Regenerating: 1 file(s) changed at 2018-03-16 12:04:56 ...done in 13.638151 seconds.
Once it's done updating, view your changes on http://localhost:4000/.
~/work/sandboxes/openliberty.io/src/main/content (blogSpacingAltText)# jekyll s --drafts
Configuration file: ~/work/sandboxes/openliberty.io/src/main/content/_config.yml
Source: ~/work/sandboxes/openliberty.io/src/main/content
Destination: ~/work/sandboxes/openliberty.io/src/main/content/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 23.506 seconds.
Auto-regeneration: enabled for '~/work/sandboxes/openliberty.io/src/main/content'
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
Regenerating: 1 file(s) changed at 2018-03-16 12:04:56
- First, ensure ruby is installed on your machine
- Run
ruby ./scripts/build/clone_guides.rb
- Run
git clone [email protected]:OpenLiberty/docs.git
First, install node version v12.18.3 on your system, then run:
- npm i -g http-server
- npm install -g @antora/[email protected]
- ./scripts/build_antora_dev.sh --update (note: if you want to run locally as a production env then do PROD_SITE=true ./scripts/build_antora_dev.sh --update)
- the above script run for about 30', at the end you would see something like
Starting up http-server, serving src/main/content/docs/build/site
http-server version: 14.1.0
http-server settings:
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none
Available on:
http://127.0.0.1:8080
http://192.168.86.249:8080
http://9.77.141.183:8080
Hit CTRL-C to stop the server
- Go to http://localhost:8080/docs/22.0.0.1 to see docs page.
- To clean out caching data, delete build & public folders under src/main/content/antora_ui/
To debug backend java code that run on the server side locally (src/main/content/java/io/openliberty/website)
- Build the openliberty.war, under the root of your openliberty.io git directory run:
mkdir -p target/jekyll-webapp
jekyll build --future --source src/main/content --destination target/jekyll-webapp
mvn -B package
- If you don't already have a wlp driver, download and unzip the latest wlp driver from https://openliberty.io/start from
All GA Features
- cd to wlp/bin, create defaultServer
./server create defaultServer
- Use the following server.xml, update the webApplication location to point to your openliberty.war location:
<featureManager>
<feature>jaxrs-2.1</feature>
<feature>jsonb-1.0</feature>
<feature>concurrent-1.0</feature>
<feature>cdi-2.0</feature>
<feature>mpRestClient-1.3</feature>
<feature>mpConfig-1.4</feature>
<feature>transportSecurity-1.0</feature>
<feature>mpOpenAPI-1.0</feature>
<feature>beanValidation-2.0</feature>
<feature>webCache-1.0</feature>
</featureManager>
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint"
httpPort="9080"``
httpsPort="9443" />
<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>
<!-- Default SSL configuration enables trust for default certificates from the Java runtime -->
<ssl id="defaultSSLConfig" trustDefaultCerts="true" />
<cdi12 enableImplicitBeanArchives="false"/>
<webApplication contextRoot="/" id="openlibertyio" location="/Users/aknguyen/Liberty/libertyGit/openliberty.io/target/openliberty.war"/>
<!-- <webApplication contextRoot="/" id="start" location="/Users/aknguyen/libertyGit/start.openliberty.io/target/openliberty-starter-1.0-SNAPSHOT.war"/> -->
<logging traceSpecification="io.openliberty.website.starter.*=all"></logging>
<keyStore id="defaultKeyStore"/>
- Start defaultServer, run
./server run defaultServer
- Go to https://localhost:9443
- https://localhost:9443/api/builds/data
- Antora templates https://docs.antora.org/antora-ui-default/templates
- Handlebars https://handlebarsjs.com
If you need any help setting up your local environment, please open an issue with steps you followed and errors seen in the console (https://github.com/OpenLiberty/openliberty.io/issues/new).